def METHOD_NAME(request, edit_pk):
    edit = get_object_or_404(CommentEdit, pk=edit_pk)
    comment = edit.comment
    if not comment.author == request.user and not request.user.has_perm("forum.change_post"):
        raise PermissionDenied
    if not comment.is_visible:  # comment was hidden
        raise PermissionDenied
    if edit.deleted_by:
        raise PermissionDenied
    new_edit = CommentEdit()
    new_edit.comment = comment
    new_edit.editor = request.user
    new_edit.original_text = comment.text
    new_edit.save()
    comment.update = datetime.now()
    comment.editor = request.user
    comment.update_content(
        edit.original_text, lambda m: messages.error(request, _("Erreurs dans le markdown: {}").format("\n- ".join(m)))
    )
    # remove hat if the author doesn't have it anymore
    if comment.hat and comment.hat not in comment.author.profile.get_hats():
        comment.hat = None
    comment.save()
    return redirect(comment.get_absolute_url())