mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Connect giftcards with customer accounts (#5126)
Connect giftcards with customer accounts, show giftcards during checkout and in account , show giftcard list in backend customer view
This commit is contained in:
@@ -1221,6 +1221,7 @@ class OrderRefundView(OrderView):
|
||||
giftcard = self.request.organizer.issued_gift_cards.create(
|
||||
expires=expires,
|
||||
currency=self.request.event.currency,
|
||||
customer=order.customer,
|
||||
testmode=order.testmode
|
||||
)
|
||||
giftcard.log_action('pretix.giftcards.created', user=self.request.user, data={})
|
||||
|
||||
@@ -3085,6 +3085,8 @@ class CustomerDetailView(OrganizerDetailViewMixin, OrganizerPermissionRequiredMi
|
||||
.annotate(spending=Sum("total"))
|
||||
)
|
||||
|
||||
ctx["gift_cards"] = self.customer.customer_gift_cards.all()
|
||||
|
||||
return ctx
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user