Skip to content

Commit

Permalink
Update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasbiagioninc committed Dec 6, 2024
1 parent 09d5775 commit 0fc4a71
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def request_reset_code(request, *args, **kwargs):
email = request.data.get("email")
user = User.objects.filter(email=email).first()
if not user:
raise ValidationError(detail={"non_field_errors": ["User not found with that email"]})
raise ValidationError(detail={"non_field_errors": ["There was an error resetting your password. Try again later"]})
UserResetPasswordCodeMessages.objects.create_code(user=user, code=random_pin_generator(count=7))

return Response(status=status.HTTP_204_NO_CONTENT)
Expand All @@ -113,7 +113,7 @@ def reset_password(request, *args, **kwargs):
email = kwargs.get("email")
user = User.objects.filter(email=email).first()
if not user:
raise ValidationError(detail={"non_field_errors": ["User not found with that email"]})
raise ValidationError(detail={"non_field_errors": ["There was an error resetting your password. Try again later"]})
serializer = ResetPasswordSerializer(data=request.data, context={"user": user})
serializer.is_valid(raise_exception=True)

Expand Down

0 comments on commit 0fc4a71

Please sign in to comment.