1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00
This commit is contained in:
Lorenzo Balugani 2021-04-29 22:16:37 +02:00
parent 925ff9a9fa
commit 077524ff23
2 changed files with 2 additions and 3 deletions

View file

@ -17,7 +17,7 @@ def page_repository(rid):
+ DELETE: deletes the specified repository.
"""
user = find_user(get_jwt_identity())
repository = Repository.query.filter_by(id=request.json['id']).first()
repository = Repository.query.filter_by(id=rid).first()
if request.method == "GET":
return json_success(repository.to_json()), 200
elif request.method == "PATCH":

View file

@ -25,8 +25,7 @@ def page_user(email):
elif request.method == "DELETE":
if not user.isAdmin:
return json_error("User is not admin."), 403
deluser = request.json.get('email')
target = find_user(deluser)
target = find_user(email)
if not target:
return json_error("User not found."), 404
if user == target: