diff --git a/solution/pulse/api/users/authentication.py b/solution/pulse/api/users/authentication.py index 72241c8..aa6a6bb 100644 --- a/solution/pulse/api/users/authentication.py +++ b/solution/pulse/api/users/authentication.py @@ -15,7 +15,9 @@ class JWTAuthentication(BaseAuthentication): return "Provide a valid token in the 'Authorization' header" def authenticate(self, request): - if not IsAuthenticated in getattr(request.resolver_match.func.cls, "permission_classes", []): + if IsAuthenticated not in getattr( + request.resolver_match.func.cls, "permission_classes", [] + ): return None token = request.headers.get("Authorization", "").split("Bearer ")[-1] diff --git a/solution/pulse/api/users/urls.py b/solution/pulse/api/users/urls.py index fa74ac2..2113f61 100644 --- a/solution/pulse/api/users/urls.py +++ b/solution/pulse/api/users/urls.py @@ -42,5 +42,5 @@ urlpatterns = [ "me/updatePassword", api.users.views.PasswordChangeApiView.as_view(), name="password-change", - ) + ), ] diff --git a/solution/pulse/api/users/views.py b/solution/pulse/api/users/views.py index 82f7316..daf532d 100644 --- a/solution/pulse/api/users/views.py +++ b/solution/pulse/api/users/views.py @@ -210,7 +210,10 @@ class PasswordChangeApiView(APIView): old_password = serializer.validated_data.get("oldPassword") new_password = serializer.validated_data.get("newPassword") - if bcrypt.checkpw(old_password.encode("utf-8"), request.user.password.encode("utf-8")): + if bcrypt.checkpw( + old_password.encode("utf-8"), + request.user.password.encode("utf-8"), + ): password_hash = bcrypt.hashpw( new_password.encode("utf-8"), bcrypt.gensalt() ).decode("utf-8")