From 9bbae33e4c2e2d4b756839a3d4e48a1b3a208f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Sat, 23 Jan 2021 16:08:14 +0100 Subject: [PATCH] change response of events --- flaschengeist/plugins/schedule/__init__.py | 4 ++-- flaschengeist/plugins/schedule/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flaschengeist/plugins/schedule/__init__.py b/flaschengeist/plugins/schedule/__init__.py index e1b3a81..09234ef 100644 --- a/flaschengeist/plugins/schedule/__init__.py +++ b/flaschengeist/plugins/schedule/__init__.py @@ -66,8 +66,8 @@ def new_event_type(current_session): data = request.get_json() if "name" not in data: raise BadRequest - event_controller.create_event_type(data["name"]) - return "", CREATED + event = event_controller.create_event_type(data["name"]) + return jsonify(event) @schedule_bp.route("/event-types/", methods=["PUT", "DELETE"]) diff --git a/flaschengeist/plugins/schedule/models.py b/flaschengeist/plugins/schedule/models.py index e09b81c..b78ecb3 100644 --- a/flaschengeist/plugins/schedule/models.py +++ b/flaschengeist/plugins/schedule/models.py @@ -14,7 +14,7 @@ from flaschengeist.database import db class EventType(db.Model, ModelSerializeMixin): __tablename__ = "schedule_event_type" - id_: int = db.Column("id", db.Integer, primary_key=True) + id: int = db.Column("id", db.Integer, primary_key=True) name: str = db.Column(db.String(30), nullable=False, unique=True)