Skip to content
Snippets Groups Projects
Commit 37c2acd3 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Simplify next event lookup

parent 1c119620
No related branches found
No related tags found
No related merge requests found
...@@ -47,11 +47,7 @@ class Event(models.Model): ...@@ -47,11 +47,7 @@ class Event(models.Model):
@staticmethod @staticmethod
def get_next_active(): def get_next_active():
active_events = Event.objects.filter(active=True).order_by('start') return Event.objects.filter(active=True).order_by('start').first()
if not active_events:
return None
else:
return active_events[0]
class AKOwner(models.Model): class AKOwner(models.Model):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment