Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Timothy McCurrach
> It seems like a good idea. However, it leads us to another question. Do we really need the is_staff field on the User Model if it is deprecated? User.is_staff is still used, just from Adminsite.has_permission instead: https://github.com/django/django/blob/main/django/contrib/admin/sites.py#L196

RE: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Matthew Pava
> Thoughts on deprecating it? It seems like a good idea. However, it leads us to another question. Do we really need the is_staff field on the User Model if it is deprecated? From: django-developers@googlegroups.com On Behalf Of Timothy McCurrach Sent: Tuesday, March 9, 2021 3:22 PM To:

Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Timothy McCurrach
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

Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Tobias Bengfort
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,

Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Carlton Gibson
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

Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Tobias Bengfort
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

Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Carlton Gibson
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.

Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Tobias Bengfort
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

Re: 'npm init django' works, maybe let's stop that?

2021-03-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I re-submitted my proposal through the "contact the foundation" form ( https://www.djangoproject.com/contact/foundation/ ) since that is the only way I know of contacting the board. On Mon, 8 Mar 2021 at 08:09, Florian Apolloner wrote: > Mhm, I expected such an answer when I hit send :) I maybe

Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
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

Re: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Carlton Gibson
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… 樂 —

Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Tobias Bengfort
Hi, while reading the documentation on django's admin site I noticed there are two mechanisms to check for authentication: AdminSite.admin_view[0] and staff_member_required[1]. I am not sure when I should use which of them. So what is the difference between the two? I expect that

Re: The blacklist / master issue

2021-03-09 Thread Markus Holtermann
Hi all, Mariusz renamed the branches this morning and merged the corresponding pull requests. Thank you! Please let us know if you spot problems so they can be fixed. Cheers, Markus On Tue, Mar 2, 2021, at 6:05 PM, Markus Holtermann wrote: > Brief update on this. > > The overall tracking