diff options
| author | Raphael Michel <mail@raphaelmichel.de> | 2015-06-05 10:08:19 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-06-08 13:44:39 -0400 |
| commit | 39937de7e60052d3ffa9f07fdbb9262aced35d61 (patch) | |
| tree | a49b4fd14a34fb0c68825f978031d56b390fe350 /django | |
| parent | 8b1f39a727be91aab40bdb37235718ed63ae1d50 (diff) | |
Fixed #24929 -- Allowed permission_required decorator to take any iterable
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/auth/decorators.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/auth/decorators.py b/django/contrib/auth/decorators.py index 9b2504b33c..6ab428e9cd 100644 --- a/django/contrib/auth/decorators.py +++ b/django/contrib/auth/decorators.py @@ -4,6 +4,7 @@ from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import PermissionDenied from django.shortcuts import resolve_url +from django.utils import six from django.utils.decorators import available_attrs from django.utils.six.moves.urllib.parse import urlparse @@ -59,7 +60,7 @@ def permission_required(perm, login_url=None, raise_exception=False): is raised. """ def check_perms(user): - if not isinstance(perm, (list, tuple)): + if isinstance(perm, six.string_types): perms = (perm, ) else: perms = perm |
