django/blob/main/django/contrib/admin/sites.py#L196
>>>
>>> On Tue, Mar 9, 2021 at 9:45 PM Matthew Pava wrote:
>>>
>>>> > Thoughts on deprecating it?
>>>>
>>>> It seems like a good idea. However, it leads us to another que
ated?
>>>
>>>
>>>
>>> *From:* django-d...@googlegroups.com *On
>>> Behalf Of *Timothy McCurrach
>>> *Sent:* Tuesday, March 9, 2021 3:22 PM
>>> *To:* django-d...@googlegroups.com
>>> *Subject:* Re: Difference between AdminSite.admin_view a
eally need the is_staff field on the User Model if it is deprecated?
>>
>>
>>
>> *From:* django-developers@googlegroups.com <
>> django-developers@googlegroups.com> *On Behalf Of *Timothy McCurrach
>> *Sent:* Tuesday, March 9, 2021 3:22 PM
>> *To:* django
rs@googlegroups.com <
> django-developers@googlegroups.com> *On Behalf Of *Timothy McCurrach
> *Sent:* Tuesday, March 9, 2021 3:22 PM
> *To:* django-developers@googlegroups.com
> *Subject:* Re: Difference between AdminSite.admin_view and
> staff_member_required?
>
>
>
ngo-developers@googlegroups.com
Subject: Re: Difference between AdminSite.admin_view and staff_member_required?
staff_member_required feels like a bit of a relic from the past:
- It looks like before a massive refactor of the admin that happened 12 years
ago
(https://github.com/django/django/com
staff_member_required feels like a bit of a relic from the past:
- It looks like before a massive refactor of the admin that happened 12
years ago (
https://github.com/django/django/commit/a19ed8aea395e8e07164ff7d85bd7dff2f24edca)
staff_member_required played a similar role to what Adminsite.admin
On 09/03/2021 18.03, Carlton Gibson wrote:
Do you want to open a PR with suggested changes as a focus for discussion?
I would open a PR that improves the docs, but I still don't understand
the difference, so I wouldn't know what to write.
The other alternative would be remove one of them, bu
Hey Tobias.
OK, it looks like I need to review it in more depth. Possibly it does all
make sense, but the staff_member_required docs don’t read how I’d expect
them to from this conversation.
Do you want to open a PR with suggested changes as a focus for discussion?
Kind regards,
Carlton
On Tue,
I checked the git logs and learned about a neat git feature:
git log -L ':staff_member_required:django/contrib/admin/views/decorators.py
git log -L ':admin_view:django/contrib/admin/sites.py
(requires `*py diff=python` in .gitattributes)
The last commit to admin_view was in 2009. The last commi
Hi.
> On 9 Mar 2021, at 14:33, Tobias Bengfort wrote:
>
> According to [0] ...
>
> [0]
> https://docs.djangoproject.com/en/3.1/ref/contrib/admin/#the-staff-member-required-decorator
Those docs are unchanged since they were added 6 years ago.
https://github.com/django/django/commit/e8a758e941
Hi,
On Tue, 9 Mar 2021 at 11:04, Carlton Gibson wrote:
> I’ve always taken it that @staff_member_required is for decorating
> views that aren’t part of the admin, and so not accessed via
> AdminSite.get_urls().
On 09/03/2021 13.21, Adam Johnson wrote:
admin_view does extra stuff like calling the
admin_view does extra stuff like calling the admin site's get_permission
method and using the admin login page rather than the default auth one:
https://github.com/django/django/blob/98d3fd61026457a435ef5b7afce6b6e64e9f241d/django/contrib/admin/sites.py#L198
It should indeed be used only for admin
Hi Tobias.
I’ve always taken it that @staff_member_required is for decorating views that
aren’t part of the admin, and so not accessed via AdminSite.get_urls().
I don’t think I’d use AdminSite.admin_view() outside of the context in the
example there.
I can’t think why one would do that… 🤔 —
13 matches
Mail list logo