From 2ffddb2fbdfdbe0389f7788672adfffc00d0d5b6 Mon Sep 17 00:00:00 2001 From: Deimos Date: Thu, 9 Aug 2018 07:16:49 -0600 Subject: [PATCH] comment_by_id36 resource: include removed comments Not including removed comments here was preventing authors from being able to edit/delete their comments once they had been removed. --- tildes/tildes/resources/comment.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tildes/tildes/resources/comment.py b/tildes/tildes/resources/comment.py index 231ccfa..66f8310 100644 --- a/tildes/tildes/resources/comment.py +++ b/tildes/tildes/resources/comment.py @@ -15,7 +15,10 @@ from tildes.schemas.comment import CommentSchema ) def comment_by_id36(request: Request, comment_id36: str) -> Comment: """Get a comment specified by {comment_id36} in the route (or 404).""" - comment_id = id36_to_id(comment_id36) - query = request.query(Comment).filter_by(comment_id=comment_id) + query = ( + request.query(Comment) + .include_removed() + .filter_by(comment_id=id36_to_id(comment_id36)) + ) return get_resource(request, query)