healthchecks_healthchecks/hc/accounts/migrations/0036_fill_profile_reports.py
2023-10-25 18:12:12 +03:00

23 lines
647 B
Python

# Generated by Django 3.2.2 on 2021-05-24 07:38
from __future__ import annotations
from typing import Any
from django.apps.registry import Apps
from django.db import migrations
def fill_reports_field(apps: Apps, schema_editor: Any) -> None:
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)]