1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #28982 -- Simplified code with and/or.

This commit is contained in:
Дилян Палаузов
2018-01-03 18:52:12 -05:00
committed by Tim Graham
parent c2d0f8c084
commit d7b2aa24f7
55 changed files with 98 additions and 218 deletions

View File

@@ -339,9 +339,7 @@ class SimpleRowlevelBackend:
return False
def has_module_perms(self, user, app_label):
if not user.is_anonymous and not user.is_active:
return False
return app_label == "app1"
return (user.is_anonymous or user.is_active) and app_label == 'app1'
def get_all_permissions(self, user, obj=None):
if not obj: