From f85c2ae15c020971c28b86dcdc8dd82dbc04f508 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 16 Apr 2024 15:57:02 +0200 Subject: [PATCH] fix 500 error when no value is supplied --- files/routes/awards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index 8e6bc8615..897169f6e 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -180,7 +180,7 @@ def award_thing(v, thing_type, id): if obj.is_longpost and kind in {"ectoplasm", "candycorn", "candycane", "stab", "glowie", "tilt", "queen", "chud", "marsify", "Furry", "Edgy", "Femboy", "Furry Founder", "Edgy Founder", "Femboy Founder"}: abort(403, f'Long posts are protected from the {award_title} award!') - award_quantity = int(request.values.get("award_quantity", "1").strip()) + award_quantity = int(request.values.get("award_quantity", "1").strip() or 1) if award_quantity < 1 or award_quantity > 7: award_quantity = 1