diff --git a/.ruff.toml b/.ruff.toml index 7b76a0702..497d3f1eb 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -25,7 +25,7 @@ extend-select = [ ] # TODO PTH https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth ignore = ["DJ001", "SIM105", "RUF012"] -#fix = true +fix = true line-length = 88 respect-gitignore = true src = ["src"] diff --git a/src/paperless/auth.py b/src/paperless/auth.py index 7368a1894..ba9320b5d 100644 --- a/src/paperless/auth.py +++ b/src/paperless/auth.py @@ -1,3 +1,5 @@ +import logging + from django.conf import settings from django.contrib import auth from django.contrib.auth.middleware import PersistentRemoteUserMiddleware @@ -6,6 +8,8 @@ from django.http import HttpRequest from django.utils.deprecation import MiddlewareMixin from rest_framework import authentication +logger = logging.getLogger("paperless.auth") + class AutoLoginMiddleware(MiddlewareMixin): def process_request(self, request: HttpRequest): @@ -35,6 +39,7 @@ class AngularApiAuthenticationOverride(authentication.BaseAuthentication): and request.headers["Referer"].startswith("http://localhost:4200/") ): user = User.objects.filter(is_staff=True).first() + logger.debug(f"Auto-Login with user {user}") return (user, None) else: return None