[Django] #32287: AUTH_USER_MODEL does not allow the User to be from an app that has a label with a '.' in it.

9 views
Skip to first unread message

Django

unread,
Dec 21, 2020, 2:18:18 AM12/21/20
to django-...@googlegroups.com
#32287: AUTH_USER_MODEL does not allow the User to be from an app that has a label
with a '.' in it.
----------------------------------------+---------------------------------
Reporter: SuyogSoti | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: master
Severity: Normal | Keywords: AUTH_USER_MODEL
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
----------------------------------------+---------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/32287>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 21, 2020, 2:19:16 AM12/21/20
to django-...@googlegroups.com
#32287: AUTH_USER_MODEL does not allow the User to be from an app that has a label
with a '.' in it.
---------------------------------+--------------------------------------

Reporter: SuyogSoti | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: master
Severity: Normal | Resolution:

Keywords: AUTH_USER_MODEL | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by SuyogSoti):

* cc: SuyogSoti (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/32287#comment:1>

Django

unread,
Dec 21, 2020, 2:28:01 AM12/21/20
to django-...@googlegroups.com
#32287: AUTH_USER_MODEL does not allow the User to be from an app that has a label
with a '.' in it.
---------------------------------+--------------------------------------
Reporter: Suyog Soti | Owner: nobody
Type: Bug | Status: closed
Component: contrib.auth | Version: master
Severity: Normal | Resolution: invalid

Keywords: AUTH_USER_MODEL | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => invalid
* easy: 1 => 0


Comment:

`AppConfig.label` must be a valid Python identifier, it cannot contain
dots, see
[https://docs.djangoproject.com/en/3.1/ref/applications/#django.apps.AppConfig.label
docs].

--
Ticket URL: <https://code.djangoproject.com/ticket/32287#comment:2>

Reply all
Reply to author
Forward
0 new messages