Create DJ profile manually as signals won't work in migration.

This commit is contained in:
Josh Washburne 2018-01-19 12:19:45 -05:00
parent 0607d26685
commit f4ee7c5bd1

View file

@ -0,0 +1,23 @@
# Generated by Django 2.0 on 2018-01-19 17:04
from django.db import migrations
def create_dj_profile(apps, schema_editor):
User = apps.get_model('core', 'RadioUser')
Profile = apps.get_model('profiles', 'RadioProfile')
db_alias = schema_editor.connection.alias
dj = User.objects.get(is_dj=True)
profile = Profile.objects.create(user=dj)
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_initial'),
]
operations = [
migrations.RunPython(create_dj_profile),
]