mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-21 20:44:18 +00:00
Fixes
This commit is contained in:
parent
925ff9a9fa
commit
077524ff23
2 changed files with 2 additions and 3 deletions
|
@ -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":
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue