Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_next_event_time(self):
"""Determines the next event time"""
if not self._next:
try:
qs = EventTime.objects.filter(event=self.event).exclude(id__exact=self.id)
event_time= qs.filter(start__gte=self.start).order_by('start')[0]
except (EventTime.DoesNotExist, IndexError):
event_time = None
self._next = event_time
return self._next