Fixed #32034 -- Removed redundant get_app_config() call in AdminSite.app_index.

app_config.verbose_name is already in app_dict.
This commit is contained in:
Raffaele Salmaso 2020-09-22 23:05:42 +02:00 committed by Mariusz Felisiak
parent 666f2e8acd
commit 7b9596b974
1 changed files with 1 additions and 2 deletions

View File

@ -518,10 +518,9 @@ class AdminSite:
raise Http404('The requested admin page does not exist.') raise Http404('The requested admin page does not exist.')
# Sort the models alphabetically within each app. # Sort the models alphabetically within each app.
app_dict['models'].sort(key=lambda x: x['name']) app_dict['models'].sort(key=lambda x: x['name'])
app_name = apps.get_app_config(app_label).verbose_name
context = { context = {
**self.each_context(request), **self.each_context(request),
'title': _('%(app)s administration') % {'app': app_name}, 'title': _('%(app)s administration') % {'app': app_dict['name']},
'app_list': [app_dict], 'app_list': [app_dict],
'app_label': app_label, 'app_label': app_label,
**(extra_context or {}), **(extra_context or {}),