mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 13:04:19 +00:00
Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
e5c85e1604
2 changed files with 2 additions and 3 deletions
|
@ -17,7 +17,7 @@ def page_repository(rid):
|
||||||
+ DELETE: deletes the specified repository.
|
+ DELETE: deletes the specified repository.
|
||||||
"""
|
"""
|
||||||
user = find_user(get_jwt_identity())
|
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":
|
if request.method == "GET":
|
||||||
return json_success(repository.to_json()), 200
|
return json_success(repository.to_json()), 200
|
||||||
elif request.method == "PATCH":
|
elif request.method == "PATCH":
|
||||||
|
|
|
@ -25,8 +25,7 @@ def page_user(email):
|
||||||
elif request.method == "DELETE":
|
elif request.method == "DELETE":
|
||||||
if not user.isAdmin:
|
if not user.isAdmin:
|
||||||
return json_error("User is not admin."), 403
|
return json_error("User is not admin."), 403
|
||||||
deluser = request.json.get('email')
|
target = find_user(email)
|
||||||
target = find_user(deluser)
|
|
||||||
if not target:
|
if not target:
|
||||||
return json_error("User not found."), 404
|
return json_error("User not found."), 404
|
||||||
if user == target:
|
if user == target:
|
||||||
|
|
Loading…
Reference in a new issue