From 5e8278f5b2d4fbb055dd1b0a036dc7d355065fda Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 14 Oct 2023 01:23:18 +0300 Subject: [PATCH] handle incorrect thing type --- files/routes/awards.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index a2a97a520..a22a8663c 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -148,9 +148,11 @@ def award_thing(v, thing_type, id): if thing_type == 'post': thing = get_post(id) - else: + elif thing_type == 'comment': thing = get_comment(id) if not thing.parent_post and not thing.wall_user_id: abort(404) # don't let users award messages + else: + abort(400) author = thing.author