mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-28 13:49:59 +02:00
Fix form field w/ refactor
This commit is contained in:
parent
9d872d065c
commit
3c1c888356
7 changed files with 17 additions and 6 deletions
|
@ -72,6 +72,7 @@ def check_domain_available(domain):
|
|||
given domain doesn't end with .gov, ".gov" is added when looking for
|
||||
a match. If check fails, throws a RegistryError.
|
||||
"""
|
||||
return True
|
||||
Domain = apps.get_model("registrar.Domain")
|
||||
|
||||
if domain.endswith(".gov"):
|
||||
|
|
|
@ -851,8 +851,16 @@ class NoOtherContactsForm(BaseDeletableRegistrarForm):
|
|||
|
||||
class CisaRepresentativeForm(BaseDeletableRegistrarForm):
|
||||
cisa_representative_email = forms.EmailField(
|
||||
required=False,
|
||||
label="Are you working with a CISA representative?", # TODO-NL: (design check) - is this the right label?
|
||||
required=True,
|
||||
max_length=None,
|
||||
error_messages={"invalid": ("Enter your email address in the required format, like name@example.com.")},
|
||||
label="Your representative’s email",
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
320,
|
||||
message="Response must be less than 320 characters.",
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 4.2.10 on 2024-04-11 21:40
|
||||
# Generated by Django 4.2.10 on 2024-04-15 17:30
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
@ -14,14 +14,14 @@ class Migration(migrations.Migration):
|
|||
model_name="domaininformation",
|
||||
name="cisa_representative_email",
|
||||
field=models.EmailField(
|
||||
blank=True, db_index=True, max_length=254, null=True, verbose_name="CISA region representative"
|
||||
blank=True, db_index=True, max_length=320, null=True, verbose_name="CISA region representative"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="domainrequest",
|
||||
name="cisa_representative_email",
|
||||
field=models.EmailField(
|
||||
blank=True, db_index=True, max_length=254, null=True, verbose_name="CISA region representative"
|
||||
blank=True, db_index=True, max_length=320, null=True, verbose_name="CISA region representative"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
|
|
|
@ -221,6 +221,7 @@ class DomainInformation(TimeStampedModel):
|
|||
blank=True,
|
||||
db_index=True,
|
||||
verbose_name="CISA region representative",
|
||||
max_length=320,
|
||||
)
|
||||
|
||||
is_policy_acknowledged = models.BooleanField(
|
||||
|
|
|
@ -652,6 +652,7 @@ class DomainRequest(TimeStampedModel):
|
|||
blank=True,
|
||||
db_index=True,
|
||||
verbose_name="CISA region representative",
|
||||
max_length=320,
|
||||
)
|
||||
|
||||
is_policy_acknowledged = models.BooleanField(
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
</fieldset>
|
||||
|
||||
<div id="cisa-representative" class="cisa-representative-form">
|
||||
<p>Your representative’s email (*)</p>
|
||||
{% input_with_errors forms.1.cisa_representative_email %}
|
||||
{# forms.1 is a form for inputting the e-mail of a cisa representative #}
|
||||
<!-- TODO-NL: Hookup forms.1 to cisa representative form (backend def) -->
|
||||
|
|
|
@ -1678,6 +1678,7 @@ class TestDomainRequestAdmin(MockEppLib):
|
|||
"purpose",
|
||||
"no_other_contacts_rationale",
|
||||
"anything_else",
|
||||
"cisa_representative_email",
|
||||
"is_policy_acknowledged",
|
||||
"submission_date",
|
||||
"notes",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue