diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py index 0dafe9766b..6842f49684 100644 --- a/django/contrib/admin/sites.py +++ b/django/contrib/admin/sites.py @@ -300,6 +300,7 @@ class AdminSite: 'site_url': site_url, 'has_permission': self.has_permission(request), 'available_apps': self.get_app_list(request), + 'is_popup': False, } def password_change(self, request, extra_context=None): @@ -431,6 +432,8 @@ class AdminSite: 'name': capfirst(model._meta.verbose_name_plural), 'object_name': model._meta.object_name, 'perms': perms, + 'admin_url': None, + 'add_url': None, } if perms.get('change') or perms.get('view'): model_dict['view_only'] = not perms.get('change') diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html index 0ffca672c0..768e581d1e 100644 --- a/django/contrib/admin/templates/admin/change_list.html +++ b/django/contrib/admin/templates/admin/change_list.html @@ -46,7 +46,7 @@ {% endblock %} {% endblock %} - {% if cl.formset.errors %} + {% if cl.formset and cl.formset.errors %}
{% if cl.formset.total_error_count == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
@@ -54,7 +54,7 @@ {% endif %}