mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Rejiggering code style to make upstream pycodestyle checks happy
This commit is contained in:
parent
e70ad3d493
commit
96c517d65c
@ -6,19 +6,29 @@ from django.contrib.auth.models import User
|
|||||||
and not interfere with existing user ID's.
|
and not interfere with existing user ID's.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
class User:
|
class User:
|
||||||
is_superuser = True
|
is_superuser = True
|
||||||
is_active = True
|
is_active = True
|
||||||
is_staff = True
|
is_staff = True
|
||||||
is_authenticated=True
|
is_authenticated = True
|
||||||
id = -1 #Must be -1 to avoid colliding with possible existing user ID's (that start number at 1)
|
|
||||||
|
'''
|
||||||
|
Must be -1 to avoid colliding with possible
|
||||||
|
existing user ID's (that start number at 1)
|
||||||
|
'''
|
||||||
|
id = -1
|
||||||
pk = -1
|
pk = -1
|
||||||
|
|
||||||
|
|
||||||
def return_true(*args, **kwargs):
|
def return_true(*args, **kwargs):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
User.has_module_perms = return_true
|
User.has_module_perms = return_true
|
||||||
User.has_perm = return_true
|
User.has_perm = return_true
|
||||||
|
|
||||||
|
|
||||||
class Middleware(object):
|
class Middleware(object):
|
||||||
def process_request(self, request):
|
def process_request(self, request):
|
||||||
request.user = User()
|
request.user = User()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user