From fa756382d1eb4c693428fec6277ae51700e7ecbd Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 26 Oct 2023 20:11:35 +0300 Subject: [PATCH] better paypig reward error message when no matching email found --- files/routes/users.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/routes/users.py b/files/routes/users.py index 617e01baa..35367b614 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1453,8 +1453,11 @@ def settings_claim_rewards(v): if not (v.email and v.email_verified): abort(400, f"You must have a verified email to verify {patron} status and claim your rewards!") - transactions = g.db.query(Transaction).filter_by(email=v.email, claimed=None).all() + transactions = g.db.query(Transaction).filter_by(email=v.email).all() + if not transactions: + abort(400, f"No matching email found. Please ensure you’re using the same email here that you used on {DONATE_SERVICE}.") + transactions = g.db.query(Transaction).filter_by(email=v.email, claimed=None).all() if not transactions: abort(400, f"{patron} rewards already claimed!")