mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-03-31 13:35:08 -05:00
Use global_objects
This commit is contained in:
parent
f656823ceb
commit
2ee5fd7e75
@ -31,5 +31,5 @@ def settings(request):
|
||||
username__in=["consumer", "AnonymousUser"],
|
||||
).count()
|
||||
== 0
|
||||
and Document.objects.count() == 0,
|
||||
and Document.global_objects.count() == 0,
|
||||
}
|
||||
|
@ -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}`")
|
||||
|
Loading…
x
Reference in New Issue
Block a user