mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-21 20:59:01 +00:00
Fix empty invoice unhandled error
This commit is contained in:
parent
b67e671b89
commit
f304fa27f9
@ -484,9 +484,14 @@ class Logics:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def update_invoice(cls, order, user, invoice):
|
def update_invoice(cls, order, user, invoice):
|
||||||
|
|
||||||
|
# Empty invoice?
|
||||||
|
if not invoice:
|
||||||
|
return False, {
|
||||||
|
"bad_invoice":
|
||||||
|
"You submitted an empty invoice"
|
||||||
|
}
|
||||||
# only the buyer can post a buyer invoice
|
# only the buyer can post a buyer invoice
|
||||||
|
|
||||||
if not cls.is_buyer(order, user):
|
if not cls.is_buyer(order, user):
|
||||||
return False, {
|
return False, {
|
||||||
"bad_request":
|
"bad_request":
|
||||||
|
@ -459,7 +459,7 @@ class OrderView(viewsets.ViewSet):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 2) If action is 'update invoice'
|
# 2) If action is 'update invoice'
|
||||||
if action == "update_invoice" and invoice:
|
if action == "update_invoice":
|
||||||
valid, context = Logics.update_invoice(order, request.user,
|
valid, context = Logics.update_invoice(order, request.user,
|
||||||
invoice)
|
invoice)
|
||||||
if not valid:
|
if not valid:
|
||||||
|
Loading…
Reference in New Issue
Block a user