#36323: Admin pages throw errors after upgrading to 5.2
-------------------------+-----------------------------------------
Reporter: SnejPro | Type: Bug
Status: new | Component: contrib.admin
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------+-----------------------------------------
Hi,
i've upgraded to 5.2 today and now every time i access an admin page this
error is shown:
Cheers
Jens
{{{
Environment:
Request Method: GET
Request URL: https://<URL>/admin/backend/productlocation/
Django Version: 5.2
Python Version: 3.11.2
Installed Applications:
['backend.apps.BackendConfig',
'api',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_filters',
'crispy_forms',
'crispy_bootstrap5',
'rest_framework',
'rest_framework.authtoken',
'simple_history',
'djmoney',
'adrf']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'simple_history.middleware.HistoryRequestMiddleware']
Template error:
In template <Path>/PyVenv/lib/python3.11/site-
packages/django/contrib/admin/templates/admin/change_list.html, error at
line 70
setup_admin_integration.<locals>.display_for_field() got an unexpected
keyword argument 'avoid_link'
60 : {% block search %}{% search_form cl %}{% endblock %}
61 : {% block date_hierarchy %}{% if cl.date_hierarchy %}{%
date_hierarchy cl %}{% endif %}{% endblock %}
62 :
63 : <form id="changelist-form" method="post"{% if cl.formset
and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}
novalidate>{% csrf_token %}
64 : {% if cl.formset %}
65 : <div>{{ cl.formset.management_form }}</div>
66 : {% endif %}
67 :
68 : {% block result_list %}
69 : {% if action_form and actions_on_top and
cl.show_admin_actions %}{% admin_actions %}{% endif %}
70 : {% result_list cl %}
71 : {% if action_form and actions_on_bottom and
cl.show_admin_actions %}{% admin_actions %}{% endif %}
72 : {% endblock %}
73 : {% block pagination %}{% pagination cl %}{% endblock %}
74 : </form>
75 : </div>
76 : {% block filters %}
77 : {% if cl.has_filters %}
78 : <nav id="changelist-filter" aria-labelledby="changelist-
filter-header">
79 : <h2 id="changelist-filter-header">{% translate
'Filter' %}</h2>
80 : {% if cl.is_facets_optional or cl.has_active_filters
%}<div id="changelist-filter-extra-actions">
Traceback (most recent call last):
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/core/handlers/base.py", line 220, in _get_response
response = response.render()
^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/response.py", line 114, in render
self.content = self.rendered_content
^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/response.py", line 92, in rendered_content
return template.render(context, self._request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/backends/django.py", line 107, in render
return self.template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 171, in render
return self._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in render
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 977, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/loader_tags.py", line 159, in render
return compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in render
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 977, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/loader_tags.py", line 159, in render
return compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in render
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 977, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/loader_tags.py", line 65, in render
result = block.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in render
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 977, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/loader_tags.py", line 65, in render
result = block.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in render
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 1016, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in
self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/base.py", line 977, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/contrib/admin/templatetags/base.py", line 45, in render
return super().render(context)
^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/template/library.py", line 359, in render
_dict = self.func(*resolved_args, **resolved_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/contrib/admin/templatetags/admin_list.py", line 354, in
result_list
"results": list(results(cl)),
^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/contrib/admin/templatetags/admin_list.py", line 330, in
results
yield ResultList(None, items_for_result(cl, res, None))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/contrib/admin/templatetags/admin_list.py", line 321, in
__init__
super().__init__(*items)
^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>/PyVenv/lib/python3.11/site-
packages/django/contrib/admin/templatetags/admin_list.py", line 246, in
items_for_result
result_repr = display_for_field(
Exception Type: TypeError at /admin/backend/productlocation/
Exception Value: setup_admin_integration.<locals>.display_for_field() got
an unexpected keyword argument 'avoid_link'
}}}
--
Ticket URL: <
https://code.djangoproject.com/ticket/36323>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.