--
Ticket URL: <https://code.djangoproject.com/ticket/24929>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* needs_better_patch: => 0
* needs_tests: => 0
* owner: => raphaelm
* needs_docs: => 0
* has_patch: 0 => 1
Old description:
> 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 boths
> 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.
New description:
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.
--
Comment:
I created the pull request: https://github.com/django/django/pull/4790
--
Ticket URL: <https://code.djangoproject.com/ticket/24929#comment:1>
* stage: Unreviewed => Accepted
Comment:
Looks good!
--
Ticket URL: <https://code.djangoproject.com/ticket/24929#comment:2>
* needs_docs: 0 => 1
Comment:
Although I think you should add some documentation for this change.
--
Ticket URL: <https://code.djangoproject.com/ticket/24929#comment:3>
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24929#comment:4>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
* needs_docs: 1 => 0
Comment:
I added a regression test and changed one word in the documentation (list
→ iterable). Do you expect more documentation on this? If so, how? I don't
see a proper place (or a need for it).
--
Ticket URL: <https://code.djangoproject.com/ticket/24929#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/24929#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"39937de7e60052d3ffa9f07fdbb9262aced35d61" 39937de7]:
{{{
#!CommitTicketReference repository=""
revision="39937de7e60052d3ffa9f07fdbb9262aced35d61"
Fixed #24929 -- Allowed permission_required decorator to take any iterable
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24929#comment:7>