mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-12 09:37:04 +01:00
Moving auto-auth logic to more Django-flavored locations and correcting some readability/stylistic considerations requested by the upstream maintainer
This commit is contained in:
parent
e7c23cfb92
commit
151d85f2be
4 changed files with 43 additions and 45 deletions
14
src/paperless/middleware.py
Normal file
14
src/paperless/middleware.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from django.utils.deprecation import MiddlewareMixin
|
||||
from .models import User
|
||||
|
||||
class Middleware (MiddlewareMixin):
|
||||
"""
|
||||
This is a dummy authentication middleware class that creates what
|
||||
is roughly an Anonymous authenticated user so we can disable login
|
||||
and not interfere with existing user ID's. It's only used if
|
||||
login is disabled in paperless.conf (default is to require login)
|
||||
"""
|
||||
|
||||
def process_request(self, request):
|
||||
request.user = User()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue