[Plugin] schedule: Fix create event with EventType Object
This commit is contained in:
parent
2ca8d3b324
commit
a8c7ddae3d
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue