def edit_comment(post_id, comment_id): if comment_id == '0': raise NotFound else: try: posts.edit_comment(post_id, comment_id, env.request.args('text', ''), editor=env.user) except PostTextError: return render('/comment-error.html') if env.owner and env.owner.login: login = env.owner.login.lower() else: post = Post(post_id) login = post.author.login.lower() return Response(redirect='%s://%s.%s/%s#%s' % \ (env.request.protocol, login, settings.domain, post_id, comment_id))
def edit_comment(id, comment_id): text = env.request.args('text', '').strip() posts.edit_comment(id, comment_id, text, env.user) return {"id": id, "comment_id": comment_id}