from django.db import migrations def seed_rejection_template(apps, schema_editor): template = apps.get_model('notifications', 'SMSTemplate') template.objects.using(schema_editor.connection.alias).get_or_create( unit=None, event_type='PAYMENT_RECEIPT_REJECTED', defaults={ 'title': 'رد فیش واریز', 'is_active': True, 'body': 'فیش واریزی {receipt_number} به مبلغ {amount_rial} ریال رد شد.\nدلیل کارشناس: {rejection_reason}\nاصلاح و ارسال دوباره فیش: {payment_link}\n{company_name}', 'allowed_tags': ['recipient_name', 'company_name', 'notice_number', 'receipt_number', 'amount_rial', 'invoice_number', 'payment_link', 'rejection_reason'], }) class Migration(migrations.Migration): dependencies = [('notifications', '0019_alter_smstemplate_event_type')] operations = [migrations.RunPython(seed_rejection_template, migrations.RunPython.noop)]