From 99ab57dea4c5e76638135e96a2d415ac24a7d315 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 27 Dec 2022 05:52:41 +0200 Subject: [PATCH] clearer error message when replying to deleted shit --- files/routes/comments.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 317d3f3fa..ea05cb8e4 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -121,7 +121,11 @@ def comment(v:User): posting_to_submission = isinstance(post_target, Submission) if not User.can_see(v, parent): abort(404) - if not isinstance(parent, User) and parent.deleted_utc != 0: abort(404) + if not isinstance(parent, User) and parent.deleted_utc != 0: + if isinstance(parent, Submission): + abort(403, "This post has been deleted!") + else: + abort(403, "This comment has been deleted!") if posting_to_submission: sub = post_target.sub