Opened 4 years ago

Closed 4 years ago

#32287 closed Bug (invalid)

AUTH_USER_MODEL does not allow the User to be from an app that has a label with a '.' in it.

Reported by: Suyog Soti Owned by: nobody
Component: contrib.auth Version: dev
Severity: Normal Keywords: AUTH_USER_MODEL
Cc: Suyog Soti Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If I have an app called auth, that has my custom user model, I need to change the label to make it work with INSTALLED_APPS.

If I change the label to project.auth, then I have to change the AUTH_USER_MODEL to 'project.auth.User'.

This currently give an error that says that 'project.auth.User' is not of the form 'app_label.UserModel' even when it is. This because of the code here:https://github.com/django/django/blob/master/django/contrib/auth/checks.py#L15 that assumes that anything before the first split is a label and after is the model name.

I would like to fix this issue.

Change History (2)

comment:1 by Suyog Soti, 4 years ago

Cc: Suyog Soti added

comment:2 by Mariusz Felisiak, 4 years ago

Easy pickings: unset
Resolution: invalid
Status: newclosed

AppConfig.label must be a valid Python identifier, it cannot contain dots, see docs.

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