|
@ -349,3 +349,27 @@ def put_mark_comments_read(request: Request, mark_all_previous: bool) -> Respons |
|
|
_increment_topic_comments_seen(request, notification.comment) |
|
|
_increment_topic_comments_seen(request, notification.comment) |
|
|
|
|
|
|
|
|
return IC_NOOP |
|
|
return IC_NOOP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ic_view_config(route_name="comment_remove", request_method="PUT", permission="remove") |
|
|
|
|
|
def put_comment_remove(request: Request) -> Response: |
|
|
|
|
|
"""Remove a comment with Intercooler.""" |
|
|
|
|
|
comment = request.context |
|
|
|
|
|
|
|
|
|
|
|
comment.is_removed = True |
|
|
|
|
|
request.db_session.add(LogComment(LogEventType.COMMENT_REMOVE, request, comment)) |
|
|
|
|
|
|
|
|
|
|
|
return Response("Removed") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ic_view_config( |
|
|
|
|
|
route_name="comment_remove", request_method="DELETE", permission="remove" |
|
|
|
|
|
) |
|
|
|
|
|
def delete_comment_remove(request: Request) -> Response: |
|
|
|
|
|
"""Un-remove a comment with Intercooler.""" |
|
|
|
|
|
comment = request.context |
|
|
|
|
|
|
|
|
|
|
|
comment.is_removed = False |
|
|
|
|
|
request.db_session.add(LogComment(LogEventType.COMMENT_UNREMOVE, request, comment)) |
|
|
|
|
|
|
|
|
|
|
|
return Response("Un-removed") |