bornhack-website/src/program/migrations/0069_add_bogus_email_to_old...

20 lines
492 B
Python
Raw Normal View History

2018-08-19 15:31:46 +00:00
# Generated by Django 2.1 on 2018-08-19 15:14
from django.db import migrations
def add_bogus_email(apps, schema_editor):
2019-06-16 12:32:24 +00:00
Speaker = apps.get_model("program", "Speaker")
2018-08-19 15:31:46 +00:00
for speaker in Speaker.objects.all():
if not speaker.email:
speaker.email = "N/A"
speaker.save()
class Migration(migrations.Migration):
2019-06-16 12:32:24 +00:00
dependencies = [("program", "0068_add_email_to_speaker_and_speaker_proposal")]
2018-08-19 15:31:46 +00:00
2019-06-16 12:32:24 +00:00
operations = [migrations.RunPython(add_bogus_email)]