From eee3a2407582c516d785a6cfdc0b2c037f26357e Mon Sep 17 00:00:00 2001 From: Johannes Zumthurm Date: Tue, 17 Sep 2024 19:36:53 +0200 Subject: [PATCH] fix usersync return --- amivapi/users/usersync.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amivapi/users/usersync.py b/amivapi/users/usersync.py index 1a9cb636..85c02e92 100644 --- a/amivapi/users/usersync.py +++ b/amivapi/users/usersync.py @@ -3,7 +3,7 @@ # license: AGPLv3, see LICENSE for details. In addition we strongly encourage # you to buy us beer if we meet and you like the software. """Provide an endpoint to sync users as if they logged in on the Website.""" -from flask import abort, request, Blueprint, g, jsonify +from flask import abort, request, Blueprint, g from amivapi import ldap from amivapi.auth import authenticate @@ -31,7 +31,9 @@ def usersync(): nethz = request.json.get('nethz') if nethz: res = ldap.sync_one(nethz) - return jsonify(res) + if res: + return {"nethz": nethz, "message": "success"} + return {"nethz": nethz, "message": "failed"} abort(422) abort(401)