removed no-login option since it wasn't working with the new django version anyway.

This commit is contained in:
Jonas Winkler
2020-11-09 15:28:45 +01:00
parent 3b0e794b3d
commit 0f498f1016
4 changed files with 0 additions and 55 deletions

View File

@@ -1,31 +0,0 @@
from django.contrib.auth.models import User as DjangoUser
class User:
"""
This is a dummy django User used with our middleware to disable
login authentication if that is configured in paperless.conf
"""
is_superuser = True
is_active = True
is_staff = True
is_authenticated = True
@property
def id(self):
return DjangoUser.objects.order_by("pk").first().pk
@property
def pk(self):
return self.id
"""
NOTE: These are here as a hack instead of being in the User definition
NOTE: above due to the way pycodestyle handles lamdbdas.
NOTE: See https://github.com/PyCQA/pycodestyle/issues/379 for more.
"""
User.has_module_perms = lambda *_: True
User.has_perm = lambda *_: True