pass request to mark_as_refunded()
This commit is contained in:
parent
2dca419b81
commit
ab180a7c74
|
@ -80,6 +80,6 @@ class OrderAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
def mark_order_as_refunded(self, request, queryset):
|
def mark_order_as_refunded(self, request, queryset):
|
||||||
for order in queryset.filter(refunded=False):
|
for order in queryset.filter(refunded=False):
|
||||||
order.mark_as_refunded()
|
order.mark_as_refunded(request)
|
||||||
mark_order_as_refunded.description = 'Mark order(s) as refunded'
|
mark_order_as_refunded.description = 'Mark order(s) as refunded'
|
||||||
|
|
||||||
|
|
|
@ -144,9 +144,9 @@ class Order(CreatedUpdatedModel):
|
||||||
ticket.save()
|
ticket.save()
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def mark_as_refunded(self):
|
def mark_as_refunded(self, request):
|
||||||
if not self.paid:
|
if not self.paid:
|
||||||
messages.error(self.request, "Order %s is not paid so cannot mark as refunded!" % self.pk)
|
messages.error(request, "Order %s is not paid, so cannot mark it as refunded!" % self.pk)
|
||||||
else:
|
else:
|
||||||
self.refunded=True
|
self.refunded=True
|
||||||
### delete any tickets related to this order
|
### delete any tickets related to this order
|
||||||
|
|
Loading…
Reference in a new issue