mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-31 15:06:32 +02:00
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into es/2913-domain-request-screenreader
This commit is contained in:
commit
7280b34b7c
127 changed files with 11608 additions and 5770 deletions
|
@ -35,7 +35,7 @@ class RequestingEntityForm(RegistrarForm):
|
|||
# If this selection is made on the form (tracked by js), then it will toggle the form value of this.
|
||||
# In other words, this essentially tracks if the suborganization field == "Other".
|
||||
# "Other" is just an imaginary value that is otherwise invalid.
|
||||
# Note the logic in `def clean` and `handleRequestingEntityFieldset` in get-gov.js
|
||||
# Note the logic in `def clean` and `handleRequestingEntityFieldset` in getgov.min.js
|
||||
is_requesting_new_suborganization = forms.BooleanField(required=False, widget=forms.HiddenInput())
|
||||
|
||||
sub_organization = forms.ModelChoiceField(
|
||||
|
@ -115,11 +115,14 @@ class RequestingEntityForm(RegistrarForm):
|
|||
if is_requesting_new_suborganization:
|
||||
# Validate custom suborganization fields
|
||||
if not cleaned_data.get("requested_suborganization"):
|
||||
self.add_error("requested_suborganization", "Requested suborganization is required.")
|
||||
self.add_error("requested_suborganization", "Enter the name of your suborganization.")
|
||||
if not cleaned_data.get("suborganization_city"):
|
||||
self.add_error("suborganization_city", "City is required.")
|
||||
self.add_error("suborganization_city", "Enter the city where your suborganization is located.")
|
||||
if not cleaned_data.get("suborganization_state_territory"):
|
||||
self.add_error("suborganization_state_territory", "State, territory, or military post is required.")
|
||||
self.add_error(
|
||||
"suborganization_state_territory",
|
||||
"Select the state, territory, or military post where your suborganization is located.",
|
||||
)
|
||||
elif not suborganization:
|
||||
self.add_error("sub_organization", "Suborganization is required.")
|
||||
|
||||
|
@ -809,6 +812,22 @@ class AnythingElseForm(BaseDeletableRegistrarForm):
|
|||
)
|
||||
|
||||
|
||||
class PortfolioAnythingElseForm(BaseDeletableRegistrarForm):
|
||||
"""The form for the portfolio additional details page. Tied to the anything_else field."""
|
||||
|
||||
anything_else = forms.CharField(
|
||||
required=False,
|
||||
label="Anything else?",
|
||||
widget=forms.Textarea(),
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
2000,
|
||||
message="Response must be less than 2000 characters.",
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
class AnythingElseYesNoForm(BaseYesNoForm):
|
||||
"""Yes/no toggle for the anything else question on additional details"""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue