Require Stripe validation to put event online, disable button and block route

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-20 17:47:31 +01:00
parent 0438185cd4
commit e18f79b2e5
2 changed files with 11 additions and 1 deletions

View File

@@ -407,6 +407,12 @@ class AccountController extends AbstractController
throw $this->createAccessDeniedException();
}
if (!$event->isOnline() && (!$user->isStripeChargesEnabled() || !$user->isStripePayoutsEnabled())) {
$this->addFlash('error', 'Configuration Stripe requise pour mettre un evenement en ligne.');
return $this->redirectToRoute('app_account_edit_event', ['id' => $event->getId()]);
}
$event->setIsOnline(!$event->isOnline());
$em->flush();