diff options
| author | Curtis Maloney <curtis@tinbrain.net> | 2016-08-13 22:46:51 +1000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-13 08:46:51 -0400 |
| commit | d7e0cf04b77c859d895e81ddb7af06a2ccfda5a7 (patch) | |
| tree | dcac0c2ac73a9a411cce479c41dd2219b22886e0 /django/contrib/auth/models.py | |
| parent | ba749f8f87dd60b20aeaefb84ee182f192746ebf (diff) | |
Used all() and a generator for PermissionsMixin.has_perms().
Diffstat (limited to 'django/contrib/auth/models.py')
| -rw-r--r-- | django/contrib/auth/models.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 725563424a..d49730b16b 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -280,10 +280,7 @@ class PermissionsMixin(models.Model): object is passed, it checks if the user has all required perms for this object. """ - for perm in perm_list: - if not self.has_perm(perm, obj): - return False - return True + return all(self.has_perm(perm, obj) for perm in perm_list) def has_module_perms(self, app_label): """ |
