From f1c4754868989a093a184d70591f25e0db177ec7 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sat, 18 Jun 2022 23:09:21 -0700 Subject: [PATCH] Fix bad reply after submitting invoice --- api/admin.py | 4 ++-- api/logics.py | 4 ++-- api/views.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/admin.py b/api/admin.py index 50fd2743..1d027315 100644 --- a/api/admin.py +++ b/api/admin.py @@ -95,7 +95,7 @@ class LNPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin): "order_made_link", "order_taken_link", "order_escrow_link", - "order_paid_link", + "order_paid_LN_link", ) list_display_links = ("hash", "concept") change_links = ( @@ -104,7 +104,7 @@ class LNPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin): "order_made", "order_taken", "order_escrow", - "order_paid", + "order_paid_LN", ) list_filter = ("type", "concept", "status") ordering = ("-expires_at", ) diff --git a/api/logics.py b/api/logics.py index 0ce55f5f..ffd91cad 100644 --- a/api/logics.py +++ b/api/logics.py @@ -766,7 +766,7 @@ class Logics: send_message.delay(order.id,'fiat_exchange_starts') # If the order status is 'Waiting for both'. Move forward to 'waiting for escrow' - if order.status == Order.Status.WF2: + elif order.status == Order.Status.WF2: # If the escrow does not exist, or is not locked move to WFE. if order.trade_escrow == None: order.status = Order.Status.WFE @@ -780,7 +780,7 @@ class Logics: order.status = Order.Status.WFE # If the order status is 'Failed Routing'. Retry payment. - if order.status == Order.Status.FAI: + elif order.status == Order.Status.FAI: if LNNode.double_check_htlc_is_settled( order.trade_escrow.payment_hash): order.status = Order.Status.PAY diff --git a/api/views.py b/api/views.py index bc0d6853..211be71a 100644 --- a/api/views.py +++ b/api/views.py @@ -475,14 +475,14 @@ class OrderView(viewsets.ViewSet): ) # 2) If action is 'update invoice' - if action == "update_invoice": + elif action == "update_invoice": valid, context = Logics.update_invoice(order, request.user, invoice) if not valid: return Response(context, status.HTTP_400_BAD_REQUEST) # 2.b) If action is 'update address' - if action == "update_address": + elif action == "update_address": valid, context = Logics.update_address(order, request.user, address, mining_fee_rate) if not valid: