fix: enforce profile completion of applicant in all situations

This commit is contained in:
Björn Fromme
2026-03-16 12:02:59 +01:00
parent 028db7a7ee
commit 19031dba99
3 changed files with 69 additions and 12 deletions
@@ -5,8 +5,6 @@ declare(strict_types=1);
namespace App\Controller\Booking\Create;
use App\BusProNet\XmlLoader\AgencyLoader;
use App\Controller\Account\PersonalDataController;
use App\Entity\User;
use App\Exception\HotelNotFoundException;
use App\Exception\HotelNotInTravelException;
use App\Exception\NoRoomsAvailableException;
@@ -44,7 +42,6 @@ class IndexController extends AbstractController
*
* Renders a loading page that triggers the actual initialization via HTMX.
* This provides immediate visual feedback while BusProNet API calls are made.
* Redirects to profile completion if logged-in user has incomplete profile data.
*/
#[Route(
path: '/bookings/create',
@@ -56,14 +53,6 @@ class IndexController extends AbstractController
throw $this->createNotFoundException('Invalid booking parameters provided');
}
$user = $this->getUser();
if ($user instanceof User && false === $user->isProfileComplete()) {
$request->getSession()->set(PersonalDataController::SESSION_REDIRECT_KEY, $request->getUri());
return $this->redirectToRoute('app_personal_data');
}
return $this->render('booking/create/index.html.twig', [
'params' => $params,
]);