Refs #85 -- Do not sell tickets that are marked as inactive

This commit is contained in:
Raphael Michel
2015-08-13 11:44:18 +02:00
parent 4277e689b8
commit 56961337ae
4 changed files with 15 additions and 3 deletions

View File

@@ -34,7 +34,9 @@ class EventIndex(EventViewMixin, CartDisplayMixin, TemplateView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
# Fetch all items
items = self.request.event.items.all().select_related(
items = self.request.event.items.all().filter(
active=True
).select_related(
'category', # for re-grouping
).prefetch_related(
'properties', # for .get_all_available_variations()