Don't crash tests

This commit is contained in:
Mouse Reeve 2022-01-06 10:22:27 -08:00
parent d9857839dc
commit 996d1fc571

View file

@ -9,7 +9,11 @@ def get_admins(apps, schema_editor):
db_alias = schema_editor.connection.alias
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")
admins = users.objects.using(db_alias).filter(is_superuser=True)