From 1afb5b214b1f149c1f40de0c07551e5528133c91 Mon Sep 17 00:00:00 2001 From: Siebe Vlietinck Date: Wed, 13 Mar 2024 21:59:13 +0100 Subject: [PATCH] user tests zouden moeten slagen --- backend/project/utils/authentication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/project/utils/authentication.py b/backend/project/utils/authentication.py index 2c579681..cb41c7fa 100644 --- a/backend/project/utils/authentication.py +++ b/backend/project/utils/authentication.py @@ -201,6 +201,7 @@ def authorize_teacher(f): def wrap(*args, **kwargs): auth_user_id = return_authenticated_user_id() if is_teacher(auth_user_id): + kwargs["teacher_id"] = auth_user_id return f(*args, **kwargs) abort_with_message(403, "You are not authorized to perfom this action, only teachers are authorized") return wrap @@ -264,8 +265,7 @@ def authorize_user(f): @wraps(f) def wrap(*args, **kwargs): auth_user_id = return_authenticated_user_id() - user_id = args["user_id"] - + user_id = kwargs["user_id"] if auth_user_id == user_id: return f(*args, **kwargs)