mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 02:06:03 +02:00
linted
This commit is contained in:
parent
f2201c4c6e
commit
fa6b4b74b8
1 changed files with 9 additions and 24 deletions
|
@ -1992,24 +1992,15 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
custom_election_board.admin_order_field = "is_election_board" # type: ignore
|
custom_election_board.admin_order_field = "is_election_board" # type: ignore
|
||||||
custom_election_board.short_description = "Election office" # type: ignore
|
custom_election_board.short_description = "Election office" # type: ignore
|
||||||
|
|
||||||
|
|
||||||
@admin.display(description=_("Requested Domain"))
|
@admin.display(description=_("Requested Domain"))
|
||||||
def custom_requested_domain(self, obj):
|
def custom_requested_domain(self, obj):
|
||||||
# Example: Show different icons based on `status`
|
# Example: Show different icons based on `status`
|
||||||
url = reverse("admin:registrar_domainrequest_changelist") + f"{obj.id}"
|
url = reverse("admin:registrar_domainrequest_changelist") + f"{obj.id}"
|
||||||
text = obj.requested_domain
|
text = obj.requested_domain
|
||||||
icon = ''
|
|
||||||
if obj.portfolio:
|
if obj.portfolio:
|
||||||
return format_html(
|
return format_html('<a href="{}"><img src="/public/admin/img/icon-yes.svg"> {}</a>', url, text)
|
||||||
'<a href="{}"><img src="/public/admin/img/icon-yes.svg"> {}</a>',
|
return format_html('<a href="{}">{}</a>', url, text)
|
||||||
url,
|
|
||||||
text
|
|
||||||
)
|
|
||||||
return format_html(
|
|
||||||
'<a href="{}">{}</a>',
|
|
||||||
url,
|
|
||||||
text
|
|
||||||
)
|
|
||||||
custom_requested_domain.admin_order_field = "requested_domain__name" # type: ignore
|
custom_requested_domain.admin_order_field = "requested_domain__name" # type: ignore
|
||||||
|
|
||||||
# ------ Converted fields ------
|
# ------ Converted fields ------
|
||||||
|
@ -2025,11 +2016,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
if obj.portfolio:
|
if obj.portfolio:
|
||||||
url = reverse("admin:registrar_portfolio_changelist") + f"{obj.portfolio.id}"
|
url = reverse("admin:registrar_portfolio_changelist") + f"{obj.portfolio.id}"
|
||||||
text = obj.converted_organization_name
|
text = obj.converted_organization_name
|
||||||
return format_html(
|
return format_html('<a href="{}">{}</a>', url, text)
|
||||||
'<a href="{}">{}</a>',
|
|
||||||
url,
|
|
||||||
text
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
return obj.converted_organization_name
|
return obj.converted_organization_name
|
||||||
|
|
||||||
|
@ -2049,7 +2036,6 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
def converted_state_territory(self, obj):
|
def converted_state_territory(self, obj):
|
||||||
return obj.converted_state_territory
|
return obj.converted_state_territory
|
||||||
|
|
||||||
|
|
||||||
# ------ Portfolio fields ------
|
# ------ Portfolio fields ------
|
||||||
# Define methods to display fields from the related portfolio
|
# Define methods to display fields from the related portfolio
|
||||||
def portfolio_senior_official(self, obj) -> Optional[SeniorOfficial]:
|
def portfolio_senior_official(self, obj) -> Optional[SeniorOfficial]:
|
||||||
|
@ -3822,8 +3808,7 @@ class PortfolioAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
# Even though this is empty, I will leave it as a stub for easy changes in the future
|
# Even though this is empty, I will leave it as a stub for easy changes in the future
|
||||||
# rather than strip it out of our logic.
|
# rather than strip it out of our logic.
|
||||||
analyst_readonly_fields = [
|
analyst_readonly_fields = [] # type: ignore
|
||||||
]
|
|
||||||
|
|
||||||
def get_admin_users(self, obj):
|
def get_admin_users(self, obj):
|
||||||
# Filter UserPortfolioPermission objects related to the portfolio
|
# Filter UserPortfolioPermission objects related to the portfolio
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue