#24294: admin.views.decorators.staff_member_required can't be used with
decorator
syntax and extra arguments
-------------------------------+------------------------------------
Reporter: akulakov | Owner: akulakov
Type: Bug | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by carljm):
* stage: Unreviewed => Accepted
Comment:
The issue here is simply that `staff_member_required` is not written to be
automatically either a decorator or decorator-factory: it always requires
a `view_func` as its first positional argument. So it simply doesn't
support the way you are trying to use it; if you want to provide extra
options to it, you can no longer use it with `@` syntax.
If we are documenting it and making it public API, it should probably work
like `login_required`, which would make your code work.
--
Ticket URL: <https://code.djangoproject.com/ticket/24294#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.2e257ea3f26a4afc358873aa45309eaf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.