mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
fixed log entries title. linted
This commit is contained in:
parent
ddf33e365d
commit
3318018b0e
1 changed files with 16 additions and 8 deletions
|
@ -535,6 +535,18 @@ class CustomLogEntryAdmin(LogEntryAdmin):
|
|||
"user_url",
|
||||
]
|
||||
|
||||
# Loads "tabtitle" for this admin page so that on render the <title>
|
||||
# element will only have the model name instead of
|
||||
# the default string loaded by native Django admin code.
|
||||
# (Eg. instead of "Select contact to change", display "Contacts")
|
||||
# see "base_site.html" for the <title> code.
|
||||
def changelist_view(self, request, extra_context=None):
|
||||
if extra_context is None:
|
||||
extra_context = {}
|
||||
extra_context["tabtitle"] = str(self.opts.verbose_name_plural).title()
|
||||
# Get the filtered values
|
||||
return super().changelist_view(request, extra_context=extra_context)
|
||||
|
||||
# We name the custom prop 'resource' because linter
|
||||
# is not allowing a short_description attr on it
|
||||
# This gets around the linter limitation, for now.
|
||||
|
@ -1043,11 +1055,7 @@ class MyUserAdmin(BaseUserAdmin, ImportExportModelAdmin):
|
|||
|
||||
portfolio_ids = obj.get_portfolios().values_list("portfolio", flat=True)
|
||||
portfolios = models.Portfolio.objects.filter(id__in=portfolio_ids)
|
||||
extra_context = {
|
||||
"domain_requests": domain_requests,
|
||||
"domains": domains,
|
||||
"portfolios": portfolios
|
||||
}
|
||||
extra_context = {"domain_requests": domain_requests, "domains": domains, "portfolios": portfolios}
|
||||
return super().change_view(request, object_id, form_url, extra_context)
|
||||
|
||||
# Loads "tabtitle" for this admin page so that on render the <title>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue