From f920371f3ac4277aa0d7c33c4bd72057a3244886 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 29 Jul 2022 02:43:22 +0200 Subject: [PATCH] fix this https://rdrama.co/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/2395188?context=8#context --- files/routes/reporting.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/files/routes/reporting.py b/files/routes/reporting.py index a98c24501..334c35229 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -23,10 +23,6 @@ def api_flag_post(pid, v): reason = reason[:100] - if not reason.startswith('!'): - existing = g.db.query(Flag.post_id).filter_by(user_id=v.id, post_id=post.id).one_or_none() - if existing: return "", 409 - reason = filter_emojis_only(reason) if len(reason) > 350: return {"error": "Too long."} @@ -67,6 +63,8 @@ def api_flag_post(pid, v): return {"message": f"Post moved to /h/{post.sub}"} else: + existing = g.db.query(Flag.post_id).filter_by(user_id=v.id, post_id=post.id).one_or_none() + if existing: return "", 409 flag = Flag(post_id=post.id, user_id=v.id, reason=reason) g.db.add(flag)