mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 10:16:13 +02:00
reverted a few suggested commits -- fixed issues
This commit is contained in:
parent
4e8d15bbc9
commit
eb4cd2719e
1 changed files with 5 additions and 3 deletions
|
@ -1980,8 +1980,10 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
)
|
)
|
||||||
|
|
||||||
def queryset(self, request, queryset):
|
def queryset(self, request, queryset):
|
||||||
filter_for_portfolio = self.value() == "1"
|
if self.value() == "1":
|
||||||
return queryset.filter(portfolio__isnull=filter_for_portfolio)
|
return queryset.filter(Q(portfolio__isnull=False))
|
||||||
|
if self.value() == "0":
|
||||||
|
return queryset.filter(Q(portfolio__isnull=True))
|
||||||
|
|
||||||
# ------ Custom fields ------
|
# ------ Custom fields ------
|
||||||
def custom_election_board(self, obj):
|
def custom_election_board(self, obj):
|
||||||
|
@ -1993,7 +1995,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
@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", args=[obj.id])
|
url = reverse("admin:registrar_domainrequest_changelist") + f"?portfolio={obj.id}"
|
||||||
text = obj.requested_domain
|
text = obj.requested_domain
|
||||||
if obj.portfolio:
|
if obj.portfolio:
|
||||||
return format_html('<a href="{}"><img src="/public/admin/img/icon-yes.svg"> {}</a>', url, text)
|
return format_html('<a href="{}"><img src="/public/admin/img/icon-yes.svg"> {}</a>', url, text)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue