healthchecks/hc/accounts/migrations/0036_fill_profile_reports.py
Pēteris Caune 03a538c5e2
Add Profile.reports field
This is in preparation of adding an option for weekly
reports (#407)
2021-05-24 11:20:28 +03:00

19 lines
531 B
Python

# Generated by Django 3.2.2 on 2021-05-24 07:38
from django.db import migrations
def fill_reports_field(apps, schema_editor):
Profile = apps.get_model("accounts", "Profile")
Profile.objects.filter(reports_allowed=False).update(reports="off")
Profile.objects.filter(reports_allowed=True).update(reports="monthly")
class Migration(migrations.Migration):
dependencies = [
("accounts", "0035_profile_reports"),
]
operations = [migrations.RunPython(fill_reports_field, migrations.RunPython.noop)]