Rejiggering for more pycodestyle issues...

This commit is contained in:
Matt
2018-02-08 09:01:10 -05:00
parent 1ca62e5fa1
commit 98034ad6c5
2 changed files with 14 additions and 7 deletions

View File

@@ -7,13 +7,20 @@ class User:
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)
# Must be -1 to avoid colliding with real user ID's (which start at 1)
id = -1
@property
def pk(self):
return self.id
return self.id
"""
NOTE: These are here as a hack instead of being in the User definition
above due to the way pycodestyle handles lamdbdas.
See https://github.com/PyCQA/pycodestyle/issues/379 for more.
"""
User.has_module_perms = lambda *_: True
User.has_perm = lambda *_: True