diff --git a/src/documents/context_processors.py b/src/documents/context_processors.py index 8c9d22a28..32c73da10 100644 --- a/src/documents/context_processors.py +++ b/src/documents/context_processors.py @@ -1,6 +1,7 @@ from django.conf import settings as django_settings from django.contrib.auth.models import User +from documents.models import Document from paperless.config import GeneralConfig @@ -26,8 +27,9 @@ def settings(request): "domain": getattr(django_settings, "PAPERLESS_URL", request.get_host()), "APP_TITLE": app_title, "APP_LOGO": app_logo, - "HAS_USERS": User.objects.exclude( + "FIRST_INSTALL": User.objects.exclude( username__in=["consumer", "AnonymousUser"], ).count() - > 0, + == 0 + and Document.objects.count() == 0, } diff --git a/src/documents/templates/account/login.html b/src/documents/templates/account/login.html index 94cb91630..767c21d7c 100644 --- a/src/documents/templates/account/login.html +++ b/src/documents/templates/account/login.html @@ -15,7 +15,7 @@ {% endblock form_top_content %} {% block form_content %} - {% if not HAS_USERS %} + {% if FIRST_INSTALL %}