Widget: Fix crash if availability is unknown

This commit is contained in:
Raphael Michel
2021-07-16 13:49:53 +02:00
parent 2a96575b4d
commit 3fb44ec9dd

View File

@@ -559,7 +559,10 @@ class WidgetAPIProductList(EventListMixin, View):
if self.request.event.settings.event_list_available_only:
evs = [
se for se in evs
if not se.presale_has_ended and se.best_availability_state >= Quota.AVAILABILITY_RESERVED
if not se.presale_has_ended and (
se.best_availability_state is not None and
se.best_availability_state >= Quota.AVAILABILITY_RESERVED
)
]
data['events'] = [