diff --git a/config.yml b/config.yml index 29dad26..a049ae7 100644 --- a/config.yml +++ b/config.yml @@ -27,7 +27,7 @@ pretalx: apiprefix: api apikey: bb770a53b15467dfb67c03d178004aca9e4819d6 event: thsf-2023 - schedule: 0.10 + schedule: wip navbar: items: - name: Home diff --git a/src/thsf/__init__.py b/src/thsf/__init__.py index 210e022..02b1368 100644 --- a/src/thsf/__init__.py +++ b/src/thsf/__init__.py @@ -117,12 +117,12 @@ def index(): @app.route('/planning', methods=['GET']) def planning(): slots = get_slots() - for slot in slots["slots"]: - for speaker in slot["speakers"]: - speaker["biography"] = get_speaker_biography(speaker["name"]) + for slot in slots.get("slots"): + for speaker in slot.get("speakers"): + speaker["biography"] = get_speaker_biography(speaker.get("name")) return render_template("planning.html", - slots=sorted(slots["slots"], - key=lambda slot: slot["slot"]["start"]), + slots=sorted(slots.get("slots"), + key=lambda slot: slot.get("slot").get("start")), navbar=navbar.get_from_page(page="/planning")) @app.route('/place', methods=['GET']) @@ -144,8 +144,8 @@ def goodies(): def concerts(): slots = get_slots() return render_template("planning.html", - slots=sorted(slots["slots"], - key=lambda slot: slot["slot"]["start"]), + slots=sorted(slots.get("slots"), + key=lambda slot: slot.get("slot").get("start")), navbar=navbar.get_from_page(page="/concerts"), filter=["concert", "dj set"]) @@ -153,8 +153,8 @@ def concerts(): def workshops(): slots = get_slots() return render_template("planning.html", - slots=sorted(slots["slots"], - key=lambda slot: slot["slot"]["start"]), + slots=sorted(slots.get("slots"), + key=lambda slot: slot.get("slot").get("start")), navbar=navbar.get_from_page(page="/workshops"), filter=["workshop"]) @@ -162,8 +162,8 @@ def workshops(): def screenings(): slots = get_slots() return render_template("planning.html", - slots=sorted(slots["slots"], - key=lambda slot: slot["slot"]["start"]), + slots=sorted(slots.get("slots"), + key=lambda slot: slot.get("slot").get("start")), navbar=navbar.get_from_page(page="/screenings"), filter=["screening"]) @@ -171,8 +171,8 @@ def screenings(): def discussions(): slots = get_slots() return render_template("planning.html", - slots=sorted(slots["slots"], - key=lambda slot: slot["slot"]["start"]), + slots=sorted(slots.get("slots"), + key=lambda slot: slot.get("slot").get("start")), navbar=navbar.get_from_page(page="/discussions"), filter=["panel discussion"]) @@ -180,8 +180,8 @@ def discussions(): def exhibitions(): slots = get_slots() return render_template("planning.html", - slots=sorted(slots["slots"], - key=lambda slot: slot["slot"]["start"]), + slots=sorted(slots.get("slots"), + key=lambda slot: slot.get("slot").get("start")), navbar=navbar.get_from_page(page="/exhibitions"), filter=["exhibition"]) @@ -189,8 +189,8 @@ def exhibitions(): def talks(): slots = get_slots() return render_template("planning.html", - slots=sorted(slots["slots"], - key=lambda slot: slot["slot"]["start"]), + slots=sorted(slots.get("slots"), + key=lambda slot: slot.get("slot").get("start")), navbar=navbar.get_from_page(page="/talks"), filter=["talk", "light talk"])