diff --git a/game_collection/user_management.py b/game_collection/user_management.py index 0e5dc6a..18b58e3 100644 --- a/game_collection/user_management.py +++ b/game_collection/user_management.py @@ -81,6 +81,11 @@ def edit_user(user_id): return jsonify({'message': 'User not found!'}), 404 user.username = data.get('username', user.username) user.role = data.get('role', user.role) + + # Update password if provided + if 'password' in data: + user.password = generate_password_hash(data['password']) + db.session.commit() return jsonify({'message': 'User updated!'}), 200