1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-21 20:44:18 +00:00

Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
stefanogoldoni 2021-04-29 22:47:26 +02:00
commit e5c85e1604
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: