Opened 7 years ago

Closed 7 years ago

Last modified 8 months ago

#29381 new New feature (needsinfo)

Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability — at Version 1

Reported by: Sagar Chalise Owned by: nobody
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: Carlton Gibson, Ülgen Sarıkavak Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Carlton Gibson)


This is more of an idea than bug but most of the time when need to use authentication without using contrib.auth one needs to rewrite some of the parts that can be reused if it were in base_user when the interface is similar to django.contrib.auth.
I am mostly talking about update_last_login function and AnonymousUser when custom user is derived from AbstractBaseUser.

May be create AnonymousBaseUser with parts that are compatible to AbstractBaseUser in base_user.py and use that as base class for AnonymousUser. Also, update_last_login function can be moved to base_user.py so that it can be reused.

Change History (1)

comment:1 by Carlton Gibson, 7 years ago

Cc: Carlton Gibson added
Description: modified (diff)
Resolution: needsinfo
Status: newclosed

Hi Sagar. Thanks for the input.

I'm going to close this as needsinfo as is. The general idea is Yeah, possibly but it's too vague to be actionable in its current form.

If you want to push this forwards then I would recommend an exploratory PR: make some (small) changes; what tests break?; what does it allow you to do?; etc. From there we've got something concrete to assess. Does that make sense?

Please feel free to re-open this issue if you come up with something concrete along these lines!

Note: See TracTickets for help on using tickets.
Back to Top