1 # Generated by Django 2.2.28 on 2022-10-03 10:55
2 from django.conf import settings
3 from django.db import migrations
6 def move_from_getpaid(apps, schema_editor):
8 G = settings.GETPAID_BACKENDS_SETTINGS
15 Funding = apps.get_model('funding', 'Funding')
16 for f in Funding.objects.filter(status=''):
17 payment = f.payment.first()
18 # TODO: what happens when no payments any more?
21 f.created_at = payment.created_on
22 f.order_id = payment.external_id
23 f.pos_id = G.get(payment.backend, {}).get('pos_id', '')
24 assert getpaid_conf, 'Getpaid configuration removed prematurely.'
28 'in_progress': 'CANCELLED',
33 class Migration(migrations.Migration):
36 ('funding', '0008_auto_20221003_1235'),
42 migrations.RunPython.noop