diff --git a/sources/AppBundle/Controller/TicketController.php b/sources/AppBundle/Controller/TicketController.php index ebfadb89c..cf590dfe7 100644 --- a/sources/AppBundle/Controller/TicketController.php +++ b/sources/AppBundle/Controller/TicketController.php @@ -110,8 +110,11 @@ public function sponsorTicketFormAction(Request $request, $eventSlug) $ticketForm = $this->createForm(SponsorTicketType::class, $ticket, ['with_transport' => $event->getTransportInformationEnabled()]); $ticketForm->handleRequest($request); - if ($ticketForm->isSubmitted() && $ticketForm->isValid() && $sponsorTicket->getPendingInvitations() > 0) { - if ($event->getDateEndSalesSponsorToken() < new \DateTime()) { + if ($ticketForm->isSubmitted() && $ticketForm->isValid()) { + // Si c'est l'ajout d'un ticket + // Et qu'il n'y a plus d'invitation + // ou que la date du sponsoring n'est pas passée + if ($ticket->getId() === null && ($sponsorTicket->getPendingInvitations() <= 0 || $event->getDateEndSalesSponsorToken() < new \DateTime())) { return $this->render(':event/ticket:sold_out.html.twig', ['event' => $event]); }