Skip to content

Commit

Permalink
sentry error fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebamus committed Nov 21, 2024
1 parent 0ba893d commit b4fabf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions users/views/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,9 @@ def get(self, request, *args, **kwargs):
class VerificationView(View):
def get(self, request):
key = request.GET.get("key", "")

logger.info("VerificationView key :", extra={key})

try:
verification = UserVerification.objects.get(key=key)
logger.info("VerificationView key :", extra={key})
except UserVerification.DoesNotExist:
messages.warning(
self.request,
Expand Down
6 changes: 4 additions & 2 deletions users/views/users_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class RegisterForm(forms.Form):

def check_email_validation_with_dns(self, email: str) -> [str, bool]:
try:
if email is None:
raise ValueError("Email is None type")
logger.debug(
"check_email_validation_with_dns email :", extra={"email": email}
)
Expand All @@ -86,9 +88,9 @@ def check_email_validation_with_dns(self, email: str) -> [str, bool]:
)
return emailinfo.normalized, True

except EmailNotValidError as e:
except (EmailNotValidError, ValueError) as e:
logger.debug(
"EmailNotValidError :",
"Error :",
extra={"error : ": str(e)},
)
return "", False
Expand Down

0 comments on commit b4fabf9

Please sign in to comment.