public function updateAction(
        string $production_slug,
        int $id,
        Request $request,
        TokenStorageInterface $token,
        AuthorizationCheckerInterface $auth
    ): Response {
        // Lookup the post and production.
        list($post, $production) = $this->lookupEntity(Post::class, $id, $production_slug);

        // Check permissions for this action.
        if (!$auth->isGranted('edit', $post)) {
            throw new AccessDeniedException();
        }

        // Get some basic information about the user.
        $user = $token->getToken()->getUser();

        // Create a new form for the post and handle.
        if (null !== $post->getParent()) {
            $form = $this->form->create(ReplyType::class, $post);
        } else {
            $form = $this->form->create(PostType::class, $post);
        }

        // Handle the form submission.
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            // Flush entity manager, set success message and redirect.
            $this->em->flush();
            $this->session->getFlashBag()->add(
                'success',
                $this->translator->trans('post.updated', [], BkstgNoticeBoardBundle::TRANSLATION_DOMAIN)
            );

            return new RedirectResponse($this->url_generator->generate(
                'bkstg_board_show',
                ['production_slug' => $production->getSlug()]
            ));
        }

        // Render the form.
        return new Response($this->templating->render('@BkstgNoticeBoard/Post/update.html.twig', [
            'form' => $form->createView(),
            'post' => $post,
            'production' => $production,
        ]));
    }