public function settingsAction(
        string $production_slug,
        Request $request,
        AuthorizationCheckerInterface $auth
    ): Response {
        // Lookup the production by slug.
        if (null === $production = $this->em->getRepository(Production::class)->findOneBy(
            ['slug' => $production_slug]
        )) {
            throw new NotFoundHttpException();
        }

        // Must be an admin to edit settings.
        if (!$auth->isGranted('GROUP_ROLE_ADMIN', $production)) {
            throw new AccessDeniedException();
        }

        // Create and handle the form.
        $form = $this->form->create(ProductionSettingsType::class, $production);
        $form->handleRequest($request);

        // If form is submitted and valid.
        if ($form->isSubmitted() && $form->isValid()) {
            // Cascade active property to image.
            if (null !== $image = $production->getImage()) {
                $image->setActive($production->isActive());
            }

            // Cascade active property to banner.
            if (null !== $banner = $production->getBanner()) {
                $banner->setActive($production->isActive());
            }

            $this->em->persist($production);
            $this->em->flush();

            // Set success message and redirect.
            $this->session->getFlashBag()->add(
                'success',
                $this->translator->trans('production.edited', [
                    '%production%' => $production->getName(),
                ], BkstgCoreBundle::TRANSLATION_DOMAIN)
            );

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

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