Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
fix usersync return
Browse files Browse the repository at this point in the history
  • Loading branch information
nimro27 committed Sep 17, 2024
1 parent ea9d96e commit eee3a24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions amivapi/users/usersync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"}

Check warning on line 36 in amivapi/users/usersync.py

View check run for this annotation

Codecov / codecov/patch

amivapi/users/usersync.py#L34-L36

Added lines #L34 - L36 were not covered by tests
abort(422)
abort(401)

Expand Down

0 comments on commit eee3a24

Please sign in to comment.