show how many tickets get deleted when refunding an order

This commit is contained in:
Thomas Steen Rasmussen 2016-06-19 08:58:26 +02:00
parent ab180a7c74
commit 3e401f03bc

View file

@ -150,7 +150,11 @@ class Order(CreatedUpdatedModel):
else:
self.refunded=True
### delete any tickets related to this order
if self.tickets.all():
messages.success(request, "Order %s marked as refunded, deleting %s tickets..." % (self.pk, self.tickets.count()))
self.tickets.all().delete()
else:
messages.success(request, "Order %s marked as refunded, no tickets to delete" % self.pk)
self.save()
def is_not_handed_out(self):