mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-15 05:54:11 +02:00
review fixes
This commit is contained in:
parent
bffd8e2090
commit
968a68f248
5 changed files with 15 additions and 35 deletions
|
@ -2737,23 +2737,15 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportRegistrarModelAdmin):
|
||||||
def feb_naming_requirements_details(self, obj):
|
def feb_naming_requirements_details(self, obj):
|
||||||
return obj.feb_naming_requirements_details if obj.feb_naming_requirements else ""
|
return obj.feb_naming_requirements_details if obj.feb_naming_requirements else ""
|
||||||
|
|
||||||
feb_naming_requirements_details.short_description = "Domain Name Rationale:" # type: ignore
|
|
||||||
|
|
||||||
def feb_purpose_choice(self, obj):
|
def feb_purpose_choice(self, obj):
|
||||||
return obj.feb_purpose_choice if obj.feb_purpose_choice else ""
|
return obj.feb_purpose_choice if obj.feb_purpose_choice else ""
|
||||||
|
|
||||||
feb_purpose_choice.short_description = "Purpose type:" # type: ignore
|
|
||||||
|
|
||||||
def time_frame_details(self, obj):
|
def time_frame_details(self, obj):
|
||||||
return obj.time_frame_details if obj.has_timeframe else ""
|
return obj.time_frame_details if obj.has_timeframe else ""
|
||||||
|
|
||||||
time_frame_details.short_description = "Target time frame:" # type: ignore
|
|
||||||
|
|
||||||
def interagency_initiative_details(self, obj):
|
def interagency_initiative_details(self, obj):
|
||||||
return obj.interagency_initiative_details if obj.is_interagency_initiative else ""
|
return obj.interagency_initiative_details if obj.is_interagency_initiative else ""
|
||||||
|
|
||||||
interagency_initiative_details.short_description = "Interagency Initiative:" # type: ignore
|
|
||||||
|
|
||||||
def eop_stakeholder_first_name(self, obj):
|
def eop_stakeholder_first_name(self, obj):
|
||||||
return obj.eop_stakeholder_first_name if obj.eop_stakeholder_first_name else ""
|
return obj.eop_stakeholder_first_name if obj.eop_stakeholder_first_name else ""
|
||||||
|
|
||||||
|
@ -2763,10 +2755,6 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportRegistrarModelAdmin):
|
||||||
def eop_stakeholder_email(self, obj):
|
def eop_stakeholder_email(self, obj):
|
||||||
return obj.eop_stakeholder_email if obj.eop_stakeholder_email else ""
|
return obj.eop_stakeholder_email if obj.eop_stakeholder_email else ""
|
||||||
|
|
||||||
eop_stakeholder_first_name.short_description = "EOP Stakeholder First Name" # type: ignore
|
|
||||||
eop_stakeholder_last_name.short_description = "EOP Stakeholder Last Name" # type: ignore
|
|
||||||
eop_stakeholder_email.short_description = "EOP Stakeholder Email" # type: ignore
|
|
||||||
|
|
||||||
# This is just a placeholder. This field will be populated in the detail_table_fieldset view.
|
# This is just a placeholder. This field will be populated in the detail_table_fieldset view.
|
||||||
# This is not a field that exists on the model.
|
# This is not a field that exists on the model.
|
||||||
def status_history(self, obj):
|
def status_history(self, obj):
|
||||||
|
@ -3107,8 +3095,6 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportRegistrarModelAdmin):
|
||||||
"eop_stakeholder_email",
|
"eop_stakeholder_email",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
# This makes .gov domain collapsable underneath Requested By
|
|
||||||
fieldsets[2][1]["classes"] = ["collapse--dgfieldset"]
|
|
||||||
modified_fieldsets = []
|
modified_fieldsets = []
|
||||||
for name, data in fieldsets:
|
for name, data in fieldsets:
|
||||||
fields = data.get("fields", [])
|
fields = data.get("fields", [])
|
||||||
|
|
|
@ -55,19 +55,17 @@ class DomainRequest(TimeStampedModel):
|
||||||
return cls(status_name).label if status_name else None
|
return cls(status_name).label if status_name else None
|
||||||
|
|
||||||
class FEBPurposeChoices(models.TextChoices):
|
class FEBPurposeChoices(models.TextChoices):
|
||||||
WEBSITE = "website"
|
WEBSITE = "website", "Used for a new website"
|
||||||
REDIRECT = "redirect"
|
REDIRECT = "redirect", "Used as a redirect for an existing website"
|
||||||
OTHER = "other"
|
OTHER = "other", "Not for a website"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_purpose_label(cls, purpose_name: str):
|
def get_purpose_label(cls, purpose_name: str):
|
||||||
"""Returns the associated label for a given purpose name"""
|
"""Returns the associated label for a given purpose name"""
|
||||||
if purpose_name == cls.WEBSITE:
|
logger.debug(f"purpose_name: {purpose_name}")
|
||||||
return "Used for a new website"
|
logger.debug(f"label: {cls(purpose_name).label}")
|
||||||
elif purpose_name == cls.REDIRECT:
|
return cls(purpose_name).label if purpose_name else None
|
||||||
return "Used as a redirect for an existing website"
|
|
||||||
else:
|
|
||||||
return "Not for a website"
|
|
||||||
|
|
||||||
class StateTerritoryChoices(models.TextChoices):
|
class StateTerritoryChoices(models.TextChoices):
|
||||||
ALABAMA = "AL", "Alabama (AL)"
|
ALABAMA = "AL", "Alabama (AL)"
|
||||||
|
@ -520,6 +518,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
feb_naming_requirements = models.BooleanField(
|
feb_naming_requirements = models.BooleanField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
|
verbose_name="Meets Naming Requirements",
|
||||||
)
|
)
|
||||||
|
|
||||||
feb_naming_requirements_details = models.TextField(
|
feb_naming_requirements_details = models.TextField(
|
||||||
|
@ -1030,12 +1029,14 @@ class DomainRequest(TimeStampedModel):
|
||||||
has_organization_feature_flag = flag_is_active_for_user(recipient, "organization_feature")
|
has_organization_feature_flag = flag_is_active_for_user(recipient, "organization_feature")
|
||||||
is_org_user = has_organization_feature_flag and recipient.has_view_portfolio_permission(self.portfolio)
|
is_org_user = has_organization_feature_flag and recipient.has_view_portfolio_permission(self.portfolio)
|
||||||
requires_feb_questions = self.is_feb() and is_org_user
|
requires_feb_questions = self.is_feb() and is_org_user
|
||||||
|
purpose_label = DomainRequest.FEBPurposeChoices.get_purpose_label(self.purpose)
|
||||||
context = {
|
context = {
|
||||||
"domain_request": self,
|
"domain_request": self,
|
||||||
# This is the user that we refer to in the email
|
# This is the user that we refer to in the email
|
||||||
"recipient": recipient,
|
"recipient": recipient,
|
||||||
"is_org_user": is_org_user,
|
"is_org_user": is_org_user,
|
||||||
"requires_feb_questions": requires_feb_questions,
|
"requires_feb_questions": requires_feb_questions,
|
||||||
|
"purpose_label": purpose_label,
|
||||||
}
|
}
|
||||||
|
|
||||||
if custom_email_content:
|
if custom_email_content:
|
||||||
|
|
|
@ -23,7 +23,7 @@ Alternative domains:
|
||||||
{% endfor %}{% endif %}
|
{% endfor %}{% endif %}
|
||||||
Purpose of your domain:
|
Purpose of your domain:
|
||||||
{% if requires_feb_questions %}
|
{% if requires_feb_questions %}
|
||||||
{{ domain_request.feb_purpose_choice }}
|
{{ purpose_label }}
|
||||||
{{ domain_request.purpose }}
|
{{ domain_request.purpose }}
|
||||||
Target time frame:
|
Target time frame:
|
||||||
{% if domain_request.has_target_time_frame %}
|
{% if domain_request.has_target_time_frame %}
|
||||||
|
|
|
@ -72,14 +72,8 @@
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% if requires_feb_questions %}
|
{% if requires_feb_questions %}
|
||||||
<h4 class="margin-bottom-0">Purpose</h4>
|
<h4 class="margin-bottom-0">Purpose</h4>
|
||||||
{% if domain_request.feb_purpose_choice == "website" %}
|
{% if domain_request.feb_purpose_choice %}
|
||||||
<p class="margin-y-0">Used for a new website</p>
|
<p class="margin-y-0">{{purpose_label}}</p>
|
||||||
<p class="margin-y-0">{{domain_request.purpose}}</p>
|
|
||||||
{% elif domain_request.feb_purpose_choice == "redirect" %}
|
|
||||||
<p class="margin-y-0">Used as a redirect for an existing website</p>
|
|
||||||
<p class="margin-y-0">{{domain_request.purpose}}</p>
|
|
||||||
{% elif domain_request.feb_purpose_choice == "other" %}
|
|
||||||
<p class="margin-y-0">Not for a website</p>
|
|
||||||
<p class="margin-y-0">{{domain_request.purpose}}</p>
|
<p class="margin-y-0">{{domain_request.purpose}}</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="margin-y-0"><span class='text-bold text-secondary-dark'>Incomplete</span></p>
|
<p class="margin-y-0"><span class='text-bold text-secondary-dark'>Incomplete</span></p>
|
||||||
|
|
|
@ -1178,11 +1178,10 @@ class PortfolioDomainRequestStatusViewOnly(DetailView):
|
||||||
context["Step"] = PortfolioDomainRequestStep.__members__
|
context["Step"] = PortfolioDomainRequestStep.__members__
|
||||||
context["steps"] = request_step_list(wizard, PortfolioDomainRequestStep)
|
context["steps"] = request_step_list(wizard, PortfolioDomainRequestStep)
|
||||||
context["form_titles"] = wizard.titles
|
context["form_titles"] = wizard.titles
|
||||||
logger.debug(self.object.is_feb())
|
|
||||||
logger.debug(flag_is_active_for_user(self.request.user, "organization_feature"))
|
|
||||||
context["requires_feb_questions"] = self.object.is_feb() and flag_is_active_for_user(
|
context["requires_feb_questions"] = self.object.is_feb() and flag_is_active_for_user(
|
||||||
self.request.user, "organization_feature"
|
self.request.user, "organization_feature"
|
||||||
)
|
)
|
||||||
|
context["purpose_label"] = DomainRequest.FEBPurposeChoices.get_purpose_label(self.object.purpose)
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue