From ff336ff441db38c2e239c05d00a184e7810d4872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=A4ttasch?= <benjamin.haettasch@cs.tu-darmstadt.de> Date: Fri, 18 Oct 2019 01:34:05 +0200 Subject: [PATCH] Add missing "get by slug"-method for event This message is used by the mixin to find the corresponding event for a slug --- AKModel/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AKModel/models.py b/AKModel/models.py index 69478325..ddb5246b 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -24,6 +24,10 @@ class Event(models.Model): def __str__(self): return self.name + @staticmethod + def get_by_slug(slug): + return Event.objects.get(slug=slug) + class AKOwner(models.Model): """ An AKOwner describes the person organizing/holding an AK. -- GitLab