From ae1c55e91b3d28ac5e07037dc9344ec2d2359056 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 26 Mar 2022 18:44:30 +0100 Subject: [PATCH] API - remove unused query param when updated profile --- fittrackee/users/auth.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fittrackee/users/auth.py b/fittrackee/users/auth.py index 374eda0a..a6cbb5b7 100644 --- a/fittrackee/users/auth.py +++ b/fittrackee/users/auth.py @@ -443,7 +443,6 @@ def edit_user(auth_user: User) -> Union[Dict, HttpResponse]: : Union[Dict, HttpResponse]: bio = post_data.get('bio') birth_date = post_data.get('birth_date') location = post_data.get('location') - password = post_data.get('password') - - if password is not None and password != '': - message = check_password(password) - if message != '': - return InvalidPayloadErrorResponse(message) - password = bcrypt.generate_password_hash( - password, current_app.config.get('BCRYPT_LOG_ROUNDS') - ).decode() try: auth_user.first_name = first_name @@ -494,8 +484,6 @@ def edit_user(auth_user: User) -> Union[Dict, HttpResponse]: if birth_date else None ) - if password is not None and password != '': - auth_user.password = password db.session.commit() return {