From 34ea581dab01c7f025f315f97a07cd73835ae66d Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Wed, 26 Apr 2023 13:42:52 -0400 Subject: [PATCH] urlencode email address so that emails with + work. modified: make_post_sell/models/user.py modified: make_post_sell/views/authentication.py --- make_post_sell/models/user.py | 2 +- make_post_sell/views/authentication.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/make_post_sell/models/user.py b/make_post_sell/models/user.py index 5a3f609..84d5e40 100644 --- a/make_post_sell/models/user.py +++ b/make_post_sell/models/user.py @@ -159,7 +159,7 @@ class User(RBase, Base): stored_hash.encode("utf-8"), ).decode("utf-8") - #log.info("new_hash={} stored_hash={}".format(new_hash, stored_hash)) + log.info("new_hash={} stored_hash={}".format(new_hash, stored_hash)) if new_hash == stored_hash: return True diff --git a/make_post_sell/views/authentication.py b/make_post_sell/views/authentication.py index 8cca827..0a6073c 100644 --- a/make_post_sell/views/authentication.py +++ b/make_post_sell/views/authentication.py @@ -10,6 +10,8 @@ from ..lib.mail import send_verification_digits_to_email from . import get_referer_or_home +from urllib.parse import urlencode + import logging log = logging.getLogger(__name__) @@ -76,7 +78,8 @@ def join_or_log_in(request): request.session.flash(msg) - return HTTPFound("/verification-challenge?email={}".format(email)) + email_encoded = urlencode({"email": email}) + return HTTPFound("/verification-challenge?{}".format(email_encoded)) return { "title": "join or log in",