Delete Community needs to clear its contact info record, too

This commit is contained in:
2026-03-14 22:31:33 -06:00
parent 54463cb65d
commit ac546fdc56
+3
View File
@@ -610,11 +610,14 @@ func (c *Community) Delete(ctx context.Context, u *User, ipaddr string, backgrou
_, err = tx.ExecContext(ctx, "DELETE FROM commban WHERE commid = ?", c.Id) _, err = tx.ExecContext(ctx, "DELETE FROM commban WHERE commid = ?", c.Id)
if err == nil { if err == nil {
_, err = tx.ExecContext(ctx, "DELETE FROM propcomm WHERE cid = ?", c.Id) _, err = tx.ExecContext(ctx, "DELETE FROM propcomm WHERE cid = ?", c.Id)
if err == nil {
_, err = tx.ExecContext(ctx, "DELETE FROM contacts WHERE owner_commid = ?", c.Id)
if err == nil { if err == nil {
_, err = tx.ExecContext(ctx, "DELETE FROM communities WHERE commid = ?", c.Id) _, err = tx.ExecContext(ctx, "DELETE FROM communities WHERE commid = ?", c.Id)
} }
} }
} }
}
if err != nil { if err != nil {
return err return err
} }