def edit(story_id, local_id): comment = StoryComment.get(story=story_id, local_id=local_id, deleted=False) if not comment: abort(404) return common_comment.edit( 'story', comment, template='story_comment_work.html', )
def restore(story_id, local_id): comment = StoryComment.get(story=story_id, local_id=local_id, deleted=True) if not comment: abort(404) return common_comment.restore( 'story', comment, template='story_comment_restore.html', template_ajax='includes/ajax/story_comment_restore.html', template_ajax_modal=True, )
def show(story_id, local_id): story = Story.get(id=story_id) if not story: abort(404) if not story.bl.has_comments_access(current_user._get_current_object()): abort(403) comment = StoryComment.get(story=story_id, local_id=local_id) if not comment or (comment.deleted and not current_user.is_staff): abort(404) return common_comment.show('story', comment)
def abuse_storycomment(story_id, local_id): story = get_story(story_id) # Здесь проверка доступа return abuse_common('storycomment', StoryComment.get(story=story.id, local_id=local_id, deleted=False))
def abuse_storycomment(story_id, local_id): story = get_story(story_id) # Здесь проверка доступа return abuse_common( 'storycomment', StoryComment.get(story=story.id, local_id=local_id, deleted=False))
def vote(story_id, local_id): comment = StoryComment.get(story=story_id, local_id=local_id, deleted=False) if not comment: abort(404) return common_comment.vote('story', comment)