You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
501 B

  1. # Generated by Django 2.1.5 on 2019-01-12 19:50
  2. from django.db import migrations
  3. def set_badge_key(apps, schema_editor):
  4. Project = apps.get_model("accounts", "Project")
  5. for project in Project.objects.select_related("owner").all():
  6. project.badge_key = project.owner.username
  7. project.save()
  8. class Migration(migrations.Migration):
  9. dependencies = [("accounts", "0019_project_badge_key")]
  10. operations = [migrations.RunPython(set_badge_key, migrations.RunPython.noop)]