receipts
[wolnelektury.git] / src / club / migrations / 0016_migrate_plans.py
1 # Generated by Django 2.2.6 on 2019-11-27 08:49
2
3 from django.db import migrations
4
5
6 def migrate_plans(apps, schema_editor):
7     Schedule = apps.get_model('club', 'Schedule')
8     schedules = Schedule.objects.filter(method='payu-re')
9     schedules.filter(plan__interval=30).update(monthly=True)
10     schedules.filter(plan__interval=365).update(yearly=True)
11
12
13 class Migration(migrations.Migration):
14
15     dependencies = [
16         ('club', '0015_auto_20191127_0947'),
17     ]
18
19     operations = [
20         migrations.RunPython(
21             migrate_plans,
22             migrations.RunPython.noop,
23             elidable=True,
24         )
25     ]