BUGFIX: Reset password now only sends email to accounts which exist within the database

This commit is contained in:
JustIceO7
2025-03-07 01:18:05 +00:00
parent 1173896710
commit 4b9c1196d4
3 changed files with 19 additions and 5 deletions

View File

@@ -201,4 +201,15 @@ def remove_from_newsletter(email):
db.execute("""
DELETE FROM newsletter
WHERE email = ?;
""", (email,))
""", (email,))
def email_exists(email):
"""
Returns whether email exists within database
"""
with Database() as db:
data = db.fetchone("""
SELECT * FROM users
WHERE email = ?
""", (email,))
return bool(data)