Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email for signing up while awaiting verification #884

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions weasyl/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,12 @@ def create(form):
# let the already registered user know this via email (perhaps they forgot their username/password)
query_username_login = d.engine.scalar("SELECT login_name FROM login WHERE email = %(email)s", email=email)
query_username_logincreate = d.engine.scalar("SELECT login_name FROM logincreate WHERE email = %(email)s", email=email)
emailer.send(email, "Weasyl Account Creation - Account Already Exists", d.render(
"email/email_in_use_account_creation.html", [query_username_login or query_username_logincreate]))

if query_username_login:
emailer.send(email, "Weasyl Account Creation - Account Already Exists", d.render(
"email/email_in_use_account_creation.html", [query_username_login]))
else:
emailer.send(email, "Weasyl Account Creation - Account Already Exists", d.render(
"email/email_in_use_account_creation_in_progress.html", [token, query_username_logincreate]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR – this is a very important feature!

It looks like the token being sent here will correspond to the invalid logincreate record created on line 271. Do we need to look up the real one, or did you test it and find out that the one that was intended to be invalid accidentally works in this situation? :D


def verify(token, ip_address=None):
lo = d.meta.tables["login"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$def with (token, username)
Hello!

You are receiving this message because someone attempted to create an account using this email address, which is already registered to the account named "${username}". This account still needs to be verified, but only one Weasyl account may be associated with an email address.

If you are attempting to change your account name, please send an email from your registered email for your Weasyl account, ${username}, to ${M.MACRO_SUPPORT_ADDRESS} to request a username change.

To verify the account under the username "${username}", you may go to https://www.weasyl.com/verify/account?token=${token}

In the event that you forgot your password, you may reset it at https://www.weasyl.com/forgotpassword

https://www.weasyl.com