mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
fixes #745
This commit is contained in:
parent
c74d261f6a
commit
0ad2b05455
@ -1,4 +1,5 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.contrib import auth
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils.deprecation import MiddlewareMixin
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
from rest_framework import authentication
|
from rest_framework import authentication
|
||||||
@ -11,6 +12,7 @@ class AutoLoginMiddleware(MiddlewareMixin):
|
|||||||
try:
|
try:
|
||||||
request.user = User.objects.get(
|
request.user = User.objects.get(
|
||||||
username=settings.AUTO_LOGIN_USERNAME)
|
username=settings.AUTO_LOGIN_USERNAME)
|
||||||
|
auth.login(request, request.user)
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user