Opened 7 years ago

Last modified 12 months ago

#29381 new New feature

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

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
Pull Requests:9948 unmerged

Description

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.

According to the ticket's flags, the next step(s) to move this issue forward are:

  • To add tests to the patch, then uncheck the "Needs tests" flag on the ticket.
  • To write documentation for the patch, then uncheck "Needs documentation" on the ticket.
  • To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
  • If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is: [https://github.com/django/django/pull/#### PR].

Change History (0)

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