From d7b2aa24f75434c2ce50100cfef3586071e0747a Mon Sep 17 00:00:00 2001 From: Дилян Палаузов Date: Wed, 3 Jan 2018 18:52:12 -0500 Subject: Fixed #28982 -- Simplified code with and/or. --- tests/auth_tests/test_auth_backends.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/auth_tests') 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: -- cgit v1.3