Fix andi errors

This commit is contained in:
zandercymatics 2025-02-18 15:02:53 -07:00
parent 4d374b2878
commit 3a12e59db6
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
4 changed files with 22 additions and 13 deletions

View file

@ -2287,11 +2287,12 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
@admin.display(description=_("Requested Domain"))
def custom_requested_domain(self, obj):
# Example: Show different icons based on `status`
url = reverse("admin:registrar_domainrequest_changelist") + f"{obj.id}"
text = obj.requested_domain
if obj.portfolio:
return format_html('<a href="{}"><img src="/public/admin/img/icon-yes.svg"> {}</a>', url, text)
return format_html('<a href="{}">{}</a>', url, text)
return format_html(
f'<img src="/public/admin/img/icon-yes.svg" aria-hidden="true"> {escape(text)}'
)
return text
custom_requested_domain.admin_order_field = "requested_domain__name" # type: ignore