#23008: Migrations depending on django.contrib.auth with custom User model fail
---------------------------------+----------------------
Reporter: semenov | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.7-rc-1
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------
Steps to reproduce:
1. Create a new project and the new app `accounts`
2. Create the model `accounts.User`:
{{{#!python
from django.contrib.auth import models as auth_models
from django.db import models
class User(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):
name = models.CharField(max_length=255, unique=True)
USERNAME_FIELD = 'name'
}}}
3. Edit settings.py and set `AUTH_USER_MODEL = 'accounts.User'`
4. Run `manage.py makemigrations accounts`. It will crash:
{{{
...
File
"/Users/semenov/work/migrtest/venv/src/django/django/db/migrations/graph.py",
line 42, in add_dependency
raise KeyError("Dependency references nonexistent parent node %r" %
(parent,))
KeyError: u"Dependency references nonexistent parent node (u'auth',
u'__last__')"
}}}
This started to happen 2 days ago, I bisected the cause to
aba75e73db6a0baca1b721698ca24f026bb4a745 (the fix for #22970). Previously,
the migration dependencies were set to `[('auth', '__first__')]` which
worked fine. (I realize that `__last__` makes more sense, so this is not
about reverting the fix but rather making `__last__` to work on
`django.contrib.auth.migrations`.)
--
Ticket URL: <https://code.djangoproject.com/ticket/23008>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.e258066e2514ada4148157ed8349c7fe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.