fix redirect
This commit is contained in:
parent
a01775c1e2
commit
a80b18b3a6
1 changed files with 2 additions and 4 deletions
|
@ -2,6 +2,7 @@ import logging
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.shortcuts import render, get_object_or_404, redirect
|
from django.shortcuts import render, get_object_or_404, redirect
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
from django.urls import reverse
|
||||||
from services.models import (
|
from services.models import (
|
||||||
Service,
|
Service,
|
||||||
ServiceOffering,
|
ServiceOffering,
|
||||||
|
@ -35,10 +36,7 @@ def create_lead(request, slug):
|
||||||
# If there's only one plan, automatically select it
|
# If there's only one plan, automatically select it
|
||||||
if selected_offering.plans.count() == 1:
|
if selected_offering.plans.count() == 1:
|
||||||
return redirect(
|
return redirect(
|
||||||
"services:create_lead",
|
f"{reverse('services:create_lead', kwargs={'slug': service.slug})}?offering={selected_offering.id}&plan={selected_offering.plans.first().id}"
|
||||||
slug=service.slug,
|
|
||||||
offering=selected_offering.id,
|
|
||||||
plan=selected_offering.plans.first().id,
|
|
||||||
)
|
)
|
||||||
# If there are multiple plans, redirect to offering detail
|
# If there are multiple plans, redirect to offering detail
|
||||||
return redirect("services:offering_detail", slug=selected_offering.slug)
|
return redirect("services:offering_detail", slug=selected_offering.slug)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue