Django auth customing error

299 views
Skip to first unread message

Jackie

unread,
May 31, 2014, 9:25:28 AM5/31/14
to django...@googlegroups.com
I want to custom the django auth app, since the default auth app can not meet our project's requierment. Then I figure it out on my own by checking the django document at here.https://docs.djangoproject.com/en/1.6/topics/auth/customizing/#a-full-example. I tried to do that example exactly. Finally, I added AUTH_USER_MODEL = "intelic_auth.MyUser" setting in my settings.py. But I got this error below when I tried to run "python manage.py syncdb". I don't know why. I would be very appreciated if someone can help me figure it out.

CommandError: One or more models did not validate:

helpdesk.ticket: 'assigned_to' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.

helpdesk.followup: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.

helpdesk.savedsearch: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.

helpdesk.usersettings: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.

helpdesk.ticketcc: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.

Kelvin Wong

unread,
May 31, 2014, 3:40:27 PM5/31/14
to django...@googlegroups.com
In your helpdesk app you have leftover references to auth.User. Replace all of them with something like this:

user = models.ForeignKey(settings.AUTH_USER_MODEL)

K
Reply all
Reply to author
Forward
0 new messages