fix redirect

This commit is contained in:
Tobias Brunner 2025-01-30 09:52:40 +01:00
parent a01775c1e2
commit a80b18b3a6
No known key found for this signature in database

View file

@ -2,6 +2,7 @@ import logging
from django.conf import settings
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib import messages
from django.urls import reverse
from services.models import (
Service,
ServiceOffering,
@ -35,10 +36,7 @@ def create_lead(request, slug):
# If there's only one plan, automatically select it
if selected_offering.plans.count() == 1:
return redirect(
"services:create_lead",
slug=service.slug,
offering=selected_offering.id,
plan=selected_offering.plans.first().id,
f"{reverse('services:create_lead', kwargs={'slug': service.slug})}?offering={selected_offering.id}&plan={selected_offering.plans.first().id}"
)
# If there are multiple plans, redirect to offering detail
return redirect("services:offering_detail", slug=selected_offering.slug)