#23360: CircularDependencyError with AUTH_USER_MODEL set
-------------------------------+----------------------
Reporter: brian | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.7-rc-3
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------
Hello,
I am trying to get django-guardian working with Django 1.7, and I keep
getting this error:
{{{
$ python setup.py test
...
django.db.migrations.graph.CircularDependencyError: [('admin',
u'0001_initial'), ('testapp', u'0001_initial'), (u'admin',
u'0001_initial')]
}}}
As far as I can tell, this is absolutely correct, there is a circular
loop, only I don't know what to do about it. testapp/models.py contains:
{{{
from django.contrib.auth.models import AbstractUser
class CustomUser(AbstractUser, GuardianUserMixin):
custom_id = models.AutoField(primary_key=True)
}}}
settings.py contains:
{{{
AUTH_USER_MODEL = "testapp.CustomUser"
}}}
This results in a migration that contains:
{{{
dependencies = [
('auth', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('admin', '0001_initial'),
]
}}}
If I understand correctly, testapp depends on auth because it uses
AbstractUser which requires Group.
I am not sure I understand why the auth app depends on testapp.
Very experimental source with some other Django 1.7 fixes is available
here:
https://github.com/brianmay/django-guardian/tree/patched
Thanks
--
Ticket URL: <https://code.djangoproject.com/ticket/23360>
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/048.f822fb6fc14522e1442b7d6f815d6037%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.