Skip to content

Commit

Permalink
fix session issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zandercymatics committed Oct 31, 2024
1 parent aa930eb commit 37894e7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
10 changes: 3 additions & 7 deletions src/registrar/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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/<int:pk>/", include((domain_request_urls, DOMAIN_REQUEST_NAMESPACE))),
path("request/finished/", views.Finished.as_view(), name="finished"),
path("request/<int:id>/", 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"),
Expand Down
2 changes: 1 addition & 1 deletion src/registrar/templates/domain_request_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="tablet:grid-col-9">
<main id="main-content" class="grid-container register-form-step">
{% if steps.prev %}
<a href="{% namespaced_url 'domain-request' steps.prev pk=domain_request_id %}" class="breadcrumb__back">
<a href="{% namespaced_url 'domain-request' steps.prev id=domain_request_id %}" class="breadcrumb__back">
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
<use xlink:href="{%static 'img/sprite.svg'%}#arrow_back"></use>
</svg><span class="margin-left-05">Previous step</span>
Expand Down
2 changes: 1 addition & 1 deletion src/registrar/templates/domain_request_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</svg>
{% endif %}
{% endif %}
<a href="{% namespaced_url 'domain-request' this_step pk=domain_request_id %}"
<a href="{% namespaced_url 'domain-request' this_step id=domain_request_id %}"
{% if this_step == steps.current %}
class="usa-current"
{% else %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% for step in steps %}
<section class="summary-item margin-top-3">
{% 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 %}
Expand Down
2 changes: 1 addition & 1 deletion src/registrar/templates/includes/request_review_steps.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% for step in steps %}
<section class="summary-item margin-top-3">
{% 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 %}
Expand Down
8 changes: 3 additions & 5 deletions src/registrar/views/domain_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit 37894e7

Please sign in to comment.