only mark as refunded if order is paid
This commit is contained in:
parent
863b0bc175
commit
ea36b68493
|
@ -144,6 +144,9 @@ class Order(CreatedUpdatedModel):
|
|||
self.save()
|
||||
|
||||
def mark_as_refunded(self):
|
||||
if not self.paid:
|
||||
messages.error(self.request, "Order %s is not paid so cannot mark as refunded!" % self.pk)
|
||||
else:
|
||||
self.refunded=True
|
||||
### delete any tickets related to this order
|
||||
self.tickets.all().delete()
|
||||
|
|
Loading…
Reference in a new issue