1 # Generated by Django 2.2.5 on 2019-09-30 13:13
3 from django.db import migrations
6 def populate_payed_at(apps, schema_editor):
7 PayUNotification = apps.get_model('club', 'PayUNotification')
8 for notification in PayUNotification.objects.order_by('received_at'):
9 status = json.loads(notification.body)['order']['status']
10 schedule = notification.order.schedule
11 if status == 'COMPLETED' and schedule.payed_at is None:
12 schedule.payed_at = notification.received_at
15 class Migration(migrations.Migration):
18 ('club', '0012_auto_20190930_1510'),
24 migrations.RunPython.noop,