Browse Source

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.
merge-requests/25/head
Deimos 6 years ago
parent
commit
2ffddb2fbd
  1. 7
      tildes/tildes/resources/comment.py

7
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: def comment_by_id36(request: Request, comment_id36: str) -> Comment:
"""Get a comment specified by {comment_id36} in the route (or 404).""" """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) return get_resource(request, query)
Loading…
Cancel
Save