diff --git a/api/admin.py b/api/admin.py index 228fc4c9..9cf90596 100644 --- a/api/admin.py +++ b/api/admin.py @@ -318,6 +318,7 @@ class LNPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin): raw_id_fields = ( "receiver", "sender", + "order_donated", ) list_filter = ("type", "concept", "status") ordering = ("-expires_at",) diff --git a/api/migrations/0038_alter_lnpayment_order_donated.py b/api/migrations/0038_alter_lnpayment_order_donated.py new file mode 100644 index 00000000..492e9f74 --- /dev/null +++ b/api/migrations/0038_alter_lnpayment_order_donated.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.1 on 2023-05-18 14:25 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + dependencies = [ + ("api", "0037_lnpayment_order_donated_alter_lnpayment_concept_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="lnpayment", + name="order_donated", + field=models.ForeignKey( + blank=True, + default=None, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="order_donated", + to="api.order", + ), + ), + ] diff --git a/api/models/ln_payment.py b/api/models/ln_payment.py index 77ea112a..949b1e21 100644 --- a/api/models/ln_payment.py +++ b/api/models/ln_payment.py @@ -124,6 +124,7 @@ class LNPayment(models.Model): null=True, on_delete=models.SET_NULL, default=None, + blank=True, ) def __str__(self):