diff --git a/src/documents/context_processors.py b/src/documents/context_processors.py index 32c73da10..d083aaf36 100644 --- a/src/documents/context_processors.py +++ b/src/documents/context_processors.py @@ -31,5 +31,5 @@ def settings(request): username__in=["consumer", "AnonymousUser"], ).count() == 0 - and Document.objects.count() == 0, + and Document.global_objects.count() == 0, } diff --git a/src/paperless/adapter.py b/src/paperless/adapter.py index 0b9958e8c..f8517a3aa 100644 --- a/src/paperless/adapter.py +++ b/src/paperless/adapter.py @@ -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}`")