summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_auth_backends.py
diff options
context:
space:
mode:
authorДилян Палаузов <Dilyan.Palauzov@db.com>2018-01-03 18:52:12 -0500
committerTim Graham <timograham@gmail.com>2018-01-03 20:12:23 -0500
commitd7b2aa24f75434c2ce50100cfef3586071e0747a (patch)
tree9074eb7522888e744f948c52174f367a4281c200 /tests/auth_tests/test_auth_backends.py
parentc2d0f8c084456b5073252a91eeb09ab3d7453b18 (diff)
Fixed #28982 -- Simplified code with and/or.
Diffstat (limited to 'tests/auth_tests/test_auth_backends.py')
-rw-r--r--tests/auth_tests/test_auth_backends.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/auth_tests/test_auth_backends.py b/tests/auth_tests/test_auth_backends.py
index 86d535703d..390d26ea9b 100644
--- a/tests/auth_tests/test_auth_backends.py
+++ b/tests/auth_tests/test_auth_backends.py
@@ -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: