diff options
author | 2021-08-26 11:28:16 +0200 | |
---|---|---|
committer | 2021-08-26 11:28:16 +0200 | |
commit | ddc120d5e6e0f18f235a6b5bbe5ceec86efedc41 (patch) | |
tree | 08869fd4514e7ba67c57e81e001df0e1c329414c /internal/db/bundb/admin.go | |
parent | Pg to bun (#148) (diff) | |
download | gotosocial-ddc120d5e6e0f18f235a6b5bbe5ceec86efedc41.tar.xz |
fix public timeline bug (#150)
Diffstat (limited to 'internal/db/bundb/admin.go')
-rw-r--r-- | internal/db/bundb/admin.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/bundb/admin.go b/internal/db/bundb/admin.go index 67a1e8a0d..09f2d3bff 100644 --- a/internal/db/bundb/admin.go +++ b/internal/db/bundb/admin.go @@ -97,7 +97,7 @@ func (a *adminDB) NewSignup(ctx context.Context, username string, reason string, err = a.conn.NewSelect(). Model(acct). Where("username = ?", username). - Where("? IS NULL", bun.Ident("domain")). + WhereGroup(" AND ", whereEmptyOrNull("domain")). Scan(ctx) if err != nil { // we just don't have an account yet create one @@ -181,7 +181,7 @@ func (a *adminDB) CreateInstanceAccount(ctx context.Context) db.Error { NewSelect(). Model(>smodel.Account{}). Where("username = ?", username). - Where("? IS NULL", bun.Ident("domain")) + WhereGroup(" AND ", whereEmptyOrNull("domain")) count, err := existsQ.Count(ctx) if err != nil && count == 1 { a.log.Infof("instance account %s already exists", username) |