mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Add expiry dates and individual conditions to gift cards (#1656)
* Add expiry dates and individual conditions to gift cards * Display refund gift cards with more details and prettier interface * Allow to set gift card expiry and conditions when cancelling event * Extend gift card search * Fix #1565 -- Some gift card filters * Improve list of gift cards * Allow to edit gift cards * Note on validity
This commit is contained in:
@@ -20,7 +20,7 @@ from django.views.decorators.clickjacking import xframe_options_exempt
|
||||
from django.views.generic import TemplateView, View
|
||||
|
||||
from pretix.base.models import (
|
||||
CachedTicket, Invoice, Order, OrderPosition, Quota,
|
||||
CachedTicket, GiftCard, Invoice, Order, OrderPosition, Quota,
|
||||
)
|
||||
from pretix.base.models.orders import (
|
||||
CachedCombinedTicket, OrderFee, OrderPayment, OrderRefund, QuestionAnswer,
|
||||
@@ -230,6 +230,10 @@ class OrderDetails(EventViewMixin, OrderDetailMixin, CartMixin, TicketPageMixin,
|
||||
).exclude(
|
||||
provider__in=('offsetting', 'reseller', 'boxoffice', 'manual')
|
||||
)
|
||||
for r in ctx['refunds']:
|
||||
if r.provider == 'giftcard':
|
||||
gc = GiftCard.objects.get(pk=r.info_data.get('gift_card'))
|
||||
r.giftcard = gc
|
||||
|
||||
return ctx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user