Fix ci clearing users not clearing auth

This commit is contained in:
Jamie Curnow 2024-11-13 12:38:59 +10:00
parent 2145df0dfb
commit 2f334b5f9f
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E

View File

@ -89,8 +89,21 @@ func List(pageInfo model.PageInfo, filters []model.Filter, expand []string) (ent
// DeleteAll will do just that, and should only be used for testing purposes. // DeleteAll will do just that, and should only be used for testing purposes.
func DeleteAll() error { func DeleteAll() error {
db := database.GetDB() db := database.GetDB()
result := db.Exec(fmt.Sprintf(`DELETE FROM %s WHERE is_system = ?`, database.QuoteTableName("user")), false) if result := db.Exec(
return result.Error fmt.Sprintf(`DELETE FROM %s WHERE is_system = ?`, database.QuoteTableName("user")),
false,
); result.Error != nil {
return result.Error
}
if result := db.Exec(
fmt.Sprintf(`DELETE FROM %s`, database.QuoteTableName("auth")),
false,
); result.Error != nil {
return result.Error
}
return nil
} }
// GetCapabilities gets capabilities for a user // GetCapabilities gets capabilities for a user