2014-11-25 23:44:20 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import models, migrations
|
|
|
|
from django.contrib.auth import get_user_model
|
|
|
|
|
|
|
|
|
|
|
|
def add_userprofiles(apps, schema_editor):
|
2014-11-26 00:23:52 +01:00
|
|
|
User = apps.get_model("auth", "User")
|
2014-11-25 23:44:20 +01:00
|
|
|
UserProfile = apps.get_model("accounts", "UserProfile")
|
|
|
|
for user in User.objects.all():
|
|
|
|
UserProfile.objects.get_or_create(user=user)
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
('accounts', '0001_initial'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.RunPython(add_userprofiles),
|
|
|
|
]
|