mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-20 12:19:00 +00:00
Fix empty invoice unhandled error
This commit is contained in:
parent
b67e671b89
commit
f304fa27f9
@ -484,9 +484,14 @@ class Logics:
|
||||
|
||||
@classmethod
|
||||
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
|
||||
|
||||
if not cls.is_buyer(order, user):
|
||||
return False, {
|
||||
"bad_request":
|
||||
|
@ -459,7 +459,7 @@ class OrderView(viewsets.ViewSet):
|
||||
)
|
||||
|
||||
# 2) If action is 'update invoice'
|
||||
if action == "update_invoice" and invoice:
|
||||
if action == "update_invoice":
|
||||
valid, context = Logics.update_invoice(order, request.user,
|
||||
invoice)
|
||||
if not valid:
|
||||
|
Loading…
Reference in New Issue
Block a user