From 202d3bc2ddae0877ee1433695b5eba869ac7c492 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 26 Nov 2014 00:23:52 +0100 Subject: [PATCH] fix migration, only works like that previous code gave: ValueError: Cannot assign "": "UserProfile.user" must be a "User" instance. --- nsupdate/accounts/migrations/0002_auto_20141125_2325.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nsupdate/accounts/migrations/0002_auto_20141125_2325.py b/nsupdate/accounts/migrations/0002_auto_20141125_2325.py index 35e5743..7c579e3 100644 --- a/nsupdate/accounts/migrations/0002_auto_20141125_2325.py +++ b/nsupdate/accounts/migrations/0002_auto_20141125_2325.py @@ -6,7 +6,7 @@ from django.contrib.auth import get_user_model def add_userprofiles(apps, schema_editor): - User = get_user_model() + User = apps.get_model("auth", "User") UserProfile = apps.get_model("accounts", "UserProfile") for user in User.objects.all(): UserProfile.objects.get_or_create(user=user)