mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-24 18:21:13 +02:00
Use domain request wizard instead
This is a much better solution as we need to use this in the request experience anyway. This works towards that, but requires a bit of a refactor.
This commit is contained in:
parent
3127f64183
commit
a70d9d300d
7 changed files with 335 additions and 286 deletions
|
@ -4,7 +4,7 @@ from itertools import zip_longest
|
|||
from typing import Callable
|
||||
from django.db.models.fields.related import ForeignObjectRel
|
||||
from django import forms
|
||||
|
||||
from registrar.utility.enums import Step
|
||||
from registrar.models import DomainRequest, Contact
|
||||
|
||||
|
||||
|
@ -278,3 +278,16 @@ class BaseYesNoForm(RegistrarForm):
|
|||
# No pre-selection for new domain requests
|
||||
initial_value = self.form_is_checked if self.domain_request else None
|
||||
return initial_value
|
||||
|
||||
|
||||
def request_step_list(request_wizard):
|
||||
"""Dynamically generated list of steps in the form wizard."""
|
||||
step_list = []
|
||||
for step in Step:
|
||||
condition = request_wizard.WIZARD_CONDITIONS.get(step, True)
|
||||
if callable(condition):
|
||||
condition = condition(request_wizard)
|
||||
if condition:
|
||||
step_list.append(step)
|
||||
return step_list
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue