From 077524ff2377a0e318250af47ed6846e20b5652e Mon Sep 17 00:00:00 2001 From: Lorenzo Balugani Date: Thu, 29 Apr 2021 22:16:37 +0200 Subject: [PATCH] Fixes --- code/backend/nest_backend/routes/repository/repository.py | 2 +- code/backend/nest_backend/routes/users/user.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/backend/nest_backend/routes/repository/repository.py b/code/backend/nest_backend/routes/repository/repository.py index 3c7bb68..861e2b4 100644 --- a/code/backend/nest_backend/routes/repository/repository.py +++ b/code/backend/nest_backend/routes/repository/repository.py @@ -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": diff --git a/code/backend/nest_backend/routes/users/user.py b/code/backend/nest_backend/routes/users/user.py index 0f91cb4..755daa1 100644 --- a/code/backend/nest_backend/routes/users/user.py +++ b/code/backend/nest_backend/routes/users/user.py @@ -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: