forked from mirrors/bookwyrm
Don't crash tests
This commit is contained in:
parent
d9857839dc
commit
996d1fc571
1 changed files with 5 additions and 1 deletions
|
@ -9,7 +9,11 @@ def get_admins(apps, schema_editor):
|
||||||
|
|
||||||
db_alias = schema_editor.connection.alias
|
db_alias = schema_editor.connection.alias
|
||||||
groups = apps.get_model("auth", "Group")
|
groups = apps.get_model("auth", "Group")
|
||||||
group = groups.objects.using(db_alias).get(name="admin")
|
try:
|
||||||
|
group = groups.objects.using(db_alias).get(name="admin")
|
||||||
|
except groups.DoesNotExist:
|
||||||
|
# for tests
|
||||||
|
return
|
||||||
|
|
||||||
users = apps.get_model("bookwyrm", "User")
|
users = apps.get_model("bookwyrm", "User")
|
||||||
admins = users.objects.using(db_alias).filter(is_superuser=True)
|
admins = users.objects.using(db_alias).filter(is_superuser=True)
|
||||||
|
|
Loading…
Reference in a new issue