Skip to content

Commit

Permalink
Update views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxIsJoe committed Jan 21, 2024
1 parent 7cb9285 commit 6d03d36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/accounts/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def post(self, request, reset_token):
if serializer.is_valid(raise_exception=True):
reset_request = PasswordResetRequestModel.objects.get(token=reset_token)
if not reset_request.is_token_valid():
return Response({"error": "Invalid link or expired."}, status=status.HTTP_400_BAD_REQUEST)
raise PasswordResetRequestModel.DoesNotExist
account = reset_request.account
account.set_password(serializer.validated_data["password"])
account.save()
Expand Down

0 comments on commit 6d03d36

Please sign in to comment.