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
Branches
No related tags found
1 merge request!17preselect next active event when creating objects as admin
......@@ -47,11 +47,7 @@ class Event(models.Model):
@staticmethod
def get_next_active():
active_events = Event.objects.filter(active=True).order_by('start')
if not active_events:
return None
else:
return active_events[0]
return Event.objects.filter(active=True).order_by('start').first()
class AKOwner(models.Model):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment