Used all() and a generator for PermissionsMixin.has_perms().
This commit is contained in:
parent
ba749f8f87
commit
d7e0cf04b7
django/contrib/auth
|
@ -280,10 +280,7 @@ class PermissionsMixin(models.Model):
|
||||||
object is passed, it checks if the user has all required perms for this
|
object is passed, it checks if the user has all required perms for this
|
||||||
object.
|
object.
|
||||||
"""
|
"""
|
||||||
for perm in perm_list:
|
return all(self.has_perm(perm, obj) for perm in perm_list)
|
||||||
if not self.has_perm(perm, obj):
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def has_module_perms(self, app_label):
|
def has_module_perms(self, app_label):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue