Use global_objects

This commit is contained in:
shamoon 2025-03-26 15:48:23 -07:00
parent f656823ceb
commit 2ee5fd7e75
2 changed files with 3 additions and 3 deletions

View File

@ -31,5 +31,5 @@ def settings(request):
username__in=["consumer", "AnonymousUser"],
).count()
== 0
and Document.objects.count() == 0,
and Document.global_objects.count() == 0,
}

View File

@ -25,7 +25,7 @@ class CustomAccountAdapter(DefaultAccountAdapter):
if (
User.objects.exclude(username__in=["consumer", "AnonymousUser"]).count()
== 0
and Document.objects.count() == 0
and Document.global_objects.count() == 0
):
# I.e. a fresh install, allow signups
return True
@ -85,7 +85,7 @@ class CustomAccountAdapter(DefaultAccountAdapter):
if (
User.objects.exclude(username__in=["consumer", "AnonymousUser"]).count()
== 0
and Document.objects.count() == 0
and Document.global_objects.count() == 0
):
# I.e. a fresh install, make the user a superuser
logger.debug(f"Creating initial superuser `{user}`")