mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-11 18:47:13 +00: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:
1 parent
e7c23cfb92
commit
151d85f2be
4 files changed
+43
-45
No files matched your search
@@ -0,0 +1,19 @@
|
||||
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
|
||||
has_module_perms = lambda *_: True
|
||||
has_perm = lambda *_: True
|
||||
|
||||
#Must be -1 to avoid colliding with real user ID's (which start at 1)
|
||||
id = -1
|
||||
|
||||
@property
|
||||
def pk(self):
|
||||
return self.id
|
||||
|
||||
Reference in new issue
Block a user