I have two applications: One of them uses default auth.User model and the 
other one uses another AbstractUser class configured as AUTH_USER_MODEL. 
These two apps uses same codebase except their settings.py file. One of the 
models has a ForeignKey field in relation with auth.User model (I use 
auth.User as the staff model) and due to restriction of auth.User I'm not 
able to run the other application since I use custom AUTH_USER_MODEL. 
Django throws this error:

django.core.management.base.CommandError: One or more models did not 
validate:
model: 'staff' defines a relation with the model 'auth.User', which has 
been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.

I couldn't get why the usage of User model is restricted in this case. The 
only workaround I can found is monkey-patching the swappable field in User 
model's Meta field.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ef3d8725-1d78-42f0-8e24-379b0d07f895%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to