Changes between Initial Version and Version 1 of Ticket #24929
- Timestamp:
- 06/05/15 08:08:59 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24929
- Property Owner set to Raphael Michel
-
Property
Status
changed from
new
toassigned
- Property Has patch set
-
Property
Summary
changed from
permission_required decorator should take any iterable if permissions
topermission_required decorator should take any iterable of permissions
-
Ticket #24929 – Description
initial v1 1 As it came up in the discussion on ticket #24914 on GitHub (https://github.com/django/django/pull/4749#discussion_r31776720), there is no reason why permission_required only takes lists and tuples of permissions, while `has_perm ` itself can take any iterable. To be consistent with the new mixins and other parts of Django where bothsstrings and iterables of strings are accepted (see e.g. model._meta.ordering), we should change this logic. I will prepare a pull request with the same logic that is used in other places.1 As it came up in the discussion on ticket #24914 on GitHub (https://github.com/django/django/pull/4749#discussion_r31776720), there is no reason why permission_required only takes lists and tuples of permissions, while `has_perms` itself can take any iterable. To be consistent with the new mixins and other parts of Django where both strings and iterables of strings are accepted (see e.g. model._meta.ordering), we should change this logic. I will prepare a pull request with the same logic that is used in other places.