mirror of
https://github.com/pretix/pretix.git
synced 2026-05-11 16:13:59 +00:00
Add flag testmode_supported to sales channels (#1455)
* Add testmode-support-flag to SalesChannels * Make saleschannels/testmode-warnings even more dangerous! * Add warning for payment-methods that do support testmode but are being used in a non-testmode order caused by a saleschannel in a testmode-shop. * Remove redundant testmode_supported-flag for WebshopSalesChannel * Raise error on API when sales_channel does not support testmode * Tests * Fix style issue after merge
This commit is contained in:
committed by
Raphael Michel
parent
e8a2f7e349
commit
2b18621c76
@@ -294,7 +294,7 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
||||
if not self.request.event.has_subevents or self.subevent:
|
||||
# Fetch all items
|
||||
items, display_add_to_cart = get_grouped_items(self.request.event, self.subevent,
|
||||
channel=self.request.sales_channel)
|
||||
channel=self.request.sales_channel.identifier)
|
||||
context['itemnum'] = len(items)
|
||||
|
||||
# Regroup those by category
|
||||
@@ -335,7 +335,7 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
||||
|
||||
ebd = defaultdict(list)
|
||||
add_subevents_for_days(
|
||||
filter_qs_by_attr(self.request.event.subevents_annotated(self.request.sales_channel).using(settings.DATABASE_REPLICA), self.request),
|
||||
filter_qs_by_attr(self.request.event.subevents_annotated(self.request.sales_channel.identifier).using(settings.DATABASE_REPLICA), self.request),
|
||||
before, after, ebd, set(), self.request.event,
|
||||
kwargs.get('cart_namespace')
|
||||
)
|
||||
@@ -345,7 +345,7 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
||||
context['years'] = range(now().year - 2, now().year + 3)
|
||||
else:
|
||||
context['subevent_list'] = self.request.event.subevents_sorted(
|
||||
filter_qs_by_attr(self.request.event.subevents_annotated(self.request.sales_channel).using(settings.DATABASE_REPLICA), self.request)
|
||||
filter_qs_by_attr(self.request.event.subevents_annotated(self.request.sales_channel.identifier).using(settings.DATABASE_REPLICA), self.request)
|
||||
)
|
||||
|
||||
context['show_cart'] = (
|
||||
|
||||
Reference in New Issue
Block a user