Skip to content

Commit

Permalink
DST-475: update type of service (#43)
Browse files Browse the repository at this point in the history
* update type of service

* PR comments

---------

Co-authored-by: Morgan Rees <[email protected]>
  • Loading branch information
morganmaerees and Morgan Rees authored Aug 28, 2024
1 parent 38ff528 commit c4bd988
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions django_app/apply_for_a_licence/forms/forms_services.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from apply_for_a_licence import choices
from apply_for_a_licence.choices import TypeOfServicesChoices
from apply_for_a_licence.models import Services
from apply_for_a_licence.utils import get_cleaned_data_for_step
from core.crispy_fields import get_field_with_label_id
from core.forms.base_forms import BaseForm, BaseModelForm
from crispy_forms_gds.choices import Choice
Expand Down Expand Up @@ -110,8 +112,11 @@ def __init__(self, *args: object, **kwargs: object) -> None:
super().__init__(*args, **kwargs)
self.fields["service_activities"].widget.attrs = {"rows": 5}

if professional_or_business_services := self.request.session.get("TypeOfServiceView", False):
if professional_or_business_services.get("type_of_service", False) == "professional_and_business":
if professional_or_business_services := get_cleaned_data_for_step(self.request, "type_of_service"):
if (
professional_or_business_services.get("type_of_service", False)
== TypeOfServicesChoices.professional_and_business.value
):
self.fields["service_activities"].help_text = render_to_string(
"apply_for_a_licence/form_steps/partials/professional_or_business_services.html"
)

0 comments on commit c4bd988

Please sign in to comment.