Opened 3 weeks ago

Last modified 3 days ago

#28757 assigned Cleanup/optimization

Allow using forms of contrib.auth without installing contrib.auth

Reported by: Sagar Chalise Owned by: hui shang
Component: contrib.auth Version: 1.11
Severity: Normal Keywords: auth forms apps
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It seems the forms available in contrib.auth app cannot be used without using contrib.auth in settings.INSTALLED_APPS.
May be break some of reusable feature of forms into base_forms.py just like AbstractBaseUser model.

Change History (5)

comment:1 Changed 3 weeks ago by Tim Graham

Which forms are you trying to use and what error do you get?

comment:2 Changed 3 weeks ago by Sagar Chalise

Basically, I am using custom user model which avoids both groups and permissions. I could easily use Authentication as well as Password related forms but seems the forms.py directly imports User from contrib.auth.models https://github.com/django/django/blob/master/django/contrib/auth/forms.py#L10. Which seems to enforce me to install contrib.auth package.

comment:3 Changed 3 weeks ago by Tim Graham

Summary: Using forms of contrib.auth without installing contrib.authAllow using forms of contrib.auth without installing contrib.auth
Triage Stage: UnreviewedAccepted
Type: New featureCleanup/optimization

I wonder if moving that import inside the form class where it's used would be feasible and solve the issue.

comment:4 Changed 7 days ago by hui shang

Owner: changed from nobody to hui shang
Status: newassigned

comment:5 Changed 3 days ago by hui shang

Has patch: set
Last edited 3 days ago by hui shang (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top