Closed wenzhixue closed 8 years ago
Here's a diff for fix this issue:
from django.contrib.auth.models import User
78c78 < user = models.ForeignKey(User, verbosename=("user"))
user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_("user"))
Basically, all you have to do is remove the "import User" line and change the user field to "settings.AUTH_USER_MODEL" instead of "User".
Note that you must have defined AUTH_USER_MODEL correctly in your settings.py for this to work. Please see the Django 1.5+ documentation about customizing the user model for how to do this.
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x108798bd0>> Traceback (most recent call last): File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 92, in inner_run self.validate(display_num_errors=True) File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 284, in validate raise CommandError("One or more models did not validate:\n%s" % error_text) django.core.management.base.CommandError: One or more models did not validate: notification.noticesetting: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.