Event creation: Fix rare crash (PRETIXEU-8RD)

This commit is contained in:
Raphael Michel
2023-08-07 09:47:02 +02:00
parent 23e222bf13
commit 39d85fc112

View File

@@ -77,6 +77,8 @@ def get_event_domain(event, fallback=False, return_info=False):
def get_organizer_domain(organizer):
assert isinstance(organizer, Organizer)
if not organizer.pk:
return None
domain = getattr(organizer, '_cached_domain', None) or organizer.cache.get('domain')
if domain is None:
domains = organizer.domains.filter(event__isnull=True)