fix public timeline bug (#150)

This commit is contained in:
tobi 2021-08-26 11:28:16 +02:00 committed by GitHub
commit ddc120d5e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 162 additions and 79 deletions

View file

@ -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(&gtsmodel.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)