From 5b03c2535a60a40ce2df89ccb8ab9219f9fa7550 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Thu, 17 Nov 2022 13:55:07 -0600 Subject: [PATCH] kofi: fix rare 500. don't attempt to activate via kofi on sites where it's not enabled this can cause a weird 500 --- files/routes/users.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/routes/users.py b/files/routes/users.py index b1d9f7ec1..cf65ecf73 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1093,6 +1093,7 @@ kofi_tiers={ @limiter.limit(DEFAULT_RATELIMIT_SLOWER) @auth_required def settings_kofi(v): + if not KOFI_TOKEN or KOFI_TOKEN == DEFAULT_CONFIG_VALUE: abort(404) if not (v.email and v.is_activated): abort(400, f"You must have a verified email to verify {patron} status and claim your rewards!") transaction = g.db.query(Transaction).filter_by(email=v.email).order_by(Transaction.created_utc.desc()).first()