diff --git a/src/registrar/config/urls.py b/src/registrar/config/urls.py index d1551c9da..8ee89799f 100644 --- a/src/registrar/config/urls.py +++ b/src/registrar/config/urls.py @@ -39,13 +39,9 @@ from api.views import available, rdap, get_current_federal, get_current_full DOMAIN_REQUEST_NAMESPACE = views.DomainRequestWizard.URL_NAMESPACE -domain_request_start_and_finished_urls = [ - path("start/", views.DomainRequestWizard.as_view(), name="start"), - path("finished/", views.Finished.as_view(), name="finished"), -] -domain_request_urls = [] # dynamically generate the other domain_request_urls +domain_request_urls = [] for step, view in [ # add/remove steps here (Step.ORGANIZATION_TYPE, views.OrganizationType), @@ -255,8 +251,8 @@ path("health", views.health, name="health"), path("openid/", include("djangooidc.urls")), path("request/start/", views.DomainRequestWizard.as_view(), name="start"), - #path("request/", include((domain_request_start_and_finished_urls, DOMAIN_REQUEST_NAMESPACE))), - path("request//", include((domain_request_urls, DOMAIN_REQUEST_NAMESPACE))), + path("request/finished/", views.Finished.as_view(), name="finished"), + path("request//", include((domain_request_urls, DOMAIN_REQUEST_NAMESPACE))), path("api/v1/available/", available, name="available"), path("api/v1/rdap/", rdap, name="rdap"), path("api/v1/get-report/current-federal", get_current_federal, name="get-current-federal"), diff --git a/src/registrar/templates/domain_request_form.html b/src/registrar/templates/domain_request_form.html index fe1d816e6..49c61c524 100644 --- a/src/registrar/templates/domain_request_form.html +++ b/src/registrar/templates/domain_request_form.html @@ -11,7 +11,7 @@
{% if steps.prev %} - + Previous step diff --git a/src/registrar/templates/domain_request_sidebar.html b/src/registrar/templates/domain_request_sidebar.html index efdfe391e..1af54bb24 100644 --- a/src/registrar/templates/domain_request_sidebar.html +++ b/src/registrar/templates/domain_request_sidebar.html @@ -15,7 +15,7 @@ {% endif %} {% endif %} - {% if is_editable %} - {% namespaced_url 'domain-request' step pk=domain_request_id as domain_request_url %} + {% namespaced_url 'domain-request' step id=domain_request_id as domain_request_url %} {% endif %} {% if step == Step.REQUESTING_ENTITY %} diff --git a/src/registrar/templates/includes/request_review_steps.html b/src/registrar/templates/includes/request_review_steps.html index e0f76b27e..73b71d536 100644 --- a/src/registrar/templates/includes/request_review_steps.html +++ b/src/registrar/templates/includes/request_review_steps.html @@ -4,7 +4,7 @@ {% for step in steps %}
{% if is_editable %} - {% namespaced_url 'domain-request' step pk=domain_request_id as domain_request_url %} + {% namespaced_url 'domain-request' step id=domain_request_id as domain_request_url %} {% endif %} {% if step == Step.ORGANIZATION_TYPE %} diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index 70fefab11..6039a570e 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -308,6 +308,8 @@ def get(self, request, *args, **kwargs): if current_url == self.EDIT_URL_NAME and "id" in kwargs: del self.storage self.storage["domain_request_id"] = kwargs["id"] + elif "id" not in kwargs: + del self.storage # if accessing this class directly, redirect to either to an acknowledgement # page or to the first step in the processes (if an edit rather than a new request); @@ -496,11 +498,7 @@ def get_step_list(self) -> list: def goto(self, step): self.steps.current = step - self.domain_request - # Get or create the domain request - domain_request = self.domain_request - test = self.storage.get("domain_request_id") - return redirect(reverse(f"{self.URL_NAMESPACE}:{step}", kwargs={"pk": domain_request.pk})) + return redirect(reverse(f"{self.URL_NAMESPACE}:{step}", kwargs={"id": self.domain_request.id})) def goto_next_step(self): """Redirects to the next step."""