Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django migration should respect SOCIAL_AUTH_USER_MODEL setting #936

Merged
merged 2 commits into from
Jul 17, 2016

Conversation

max-arnold
Copy link
Contributor

We use stock auth.User model for administrators (without social auth) and custom UserAccount model for other types of users with enabled social auth. So we have SOCIAL_AUTH_USER_MODEL = 'customauth.UserAccount'.

The patch fixes the following failure:

./manage.py migrate --fake-initial

django.db.utils.IntegrityError: insert or update on table "social_auth_usersocialauth" violates foreign key constraint "social_auth_usersocialauth_user_id_17d28448_fk_auth_user_id"
DETAIL:  Key (user_id)=(225873) is not present in table "auth_user".

@max-arnold
Copy link
Contributor Author

Do you have any objections against this patch? To me the fix looks obvious (bundled south migrations have something similar: https://github.com/omab/python-social-auth/blob/master/social/apps/django_app/default/south_migrations/__init__.py)

@omab
Copy link
Owner

omab commented Jul 17, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants