From a8c7ddae3db028707696e71adb4ba03a2f6d44b9 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 26 Jan 2021 21:32:13 +0100 Subject: [PATCH] [Plugin] schedule: Fix create event with EventType Object --- flaschengeist/plugins/schedule/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flaschengeist/plugins/schedule/__init__.py b/flaschengeist/plugins/schedule/__init__.py index 0cf6f54..681d239 100644 --- a/flaschengeist/plugins/schedule/__init__.py +++ b/flaschengeist/plugins/schedule/__init__.py @@ -254,7 +254,10 @@ def create_event(current_session): data = request.get_json() try: start = from_iso_format(data["start"]) - event_type = event_controller.get_event_type(data["type"]) + data_type = data["type"] + if isinstance(data_type, dict): + data_type = data["type"]["id"] + event_type = event_controller.get_event_type(data_type) except (NotFound, KeyError, ValueError): raise BadRequest("Missing POST parameter")