mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Chore: Adds additional rules for Ruff linter (#5660)
This commit is contained in:
@@ -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,7 +39,7 @@ class AngularApiAuthenticationOverride(authentication.BaseAuthentication):
|
||||
and request.headers["Referer"].startswith("http://localhost:4200/")
|
||||
):
|
||||
user = User.objects.filter(is_staff=True).first()
|
||||
print(f"Auto-Login with user {user}")
|
||||
logger.debug(f"Auto-Login with user {user}")
|
||||
return (user, None)
|
||||
else:
|
||||
return None
|
||||
|
Reference in New Issue
Block a user