From ca1f2259c5c106f6e2f190226a850333f782a738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Sun, 26 Jan 2020 23:54:18 +0100 Subject: [PATCH] better return value when change ldap entrys --- geruecht/user/routes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/geruecht/user/routes.py b/geruecht/user/routes.py index 1ef4846..23958ce 100644 --- a/geruecht/user/routes.py +++ b/geruecht/user/routes.py @@ -3,6 +3,7 @@ from geruecht.decorator import login_required import geruecht.controller.userController as uc from geruecht.model import USER from datetime import datetime +import time user = Blueprint("user", __name__) @@ -43,6 +44,8 @@ def _saveConfig(**kwargs): accToken = kwargs['accToken'] data = request.get_json() accToken.user = userController.modifyUser(accToken.user, accToken.ldap_conn, data) - return jsonify(data) + retVal = accToken.user.toJSON() + retVal['creditList'] = {credit.year: credit.toJSON() for credit in accToken.user.geruechte} + return jsonify(retVal) except Exception as err: - return jsonify("error", err), 409 \ No newline at end of file + return jsonify({"error": err}), 409 \ No newline at end of file