From 77f4dac93f4f8f84417ad16c311f37c8eebcce4f Mon Sep 17 00:00:00 2001
From: Felix Blanke <info@fblanke.de>
Date: Thu, 30 May 2024 21:27:27 +0200
Subject: [PATCH] Add more event info to json export

---
 AKModel/views/ak.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/AKModel/views/ak.py b/AKModel/views/ak.py
index c65ae266..21a6fd72 100644
--- a/AKModel/views/ak.py
+++ b/AKModel/views/ak.py
@@ -144,7 +144,15 @@ class AKJSONExportView(AdminViewMixin, FilterByEventSlugMixin, ListView):
 
         context["timeslots"] = json.dumps(timeslots)
 
-        context["info_dict"] = {}
+        info_dict = {
+            "title": self.event.name,
+            "slug": self.event.slug
+        }
+        for attr in ["contact_email", "place"]:
+            if hasattr(self.event, attr) and getattr(self.event, attr):
+                info_dict[attr] = getattr(self.event, attr)
+
+        context["info_dict"] = json.dumps(info_dict)
 
         return context
 
-- 
GitLab