clearer error message when replying to deleted shit

pull/83/head
Aevann 2022-12-27 05:52:41 +02:00
parent 2bf85bb7ca
commit 99ab57dea4
1 changed files with 5 additions and 1 deletions

View File

@ -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