diff --git a/constance/admin.py b/constance/admin.py index 8d20604b..8052c317 100644 --- a/constance/admin.py +++ b/constance/admin.py @@ -2,7 +2,7 @@ from datetime import date, datetime from operator import itemgetter -from django import forms +from django import forms, get_version from django.apps import apps from django.contrib import admin, messages from django.contrib.admin.options import csrf_protect_m @@ -114,6 +114,7 @@ def changelist_view(self, request, extra_context=None): form=form, media=self.media + form.media, icon_type='svg', + django_version=get_version(), ) for name, options in settings.CONFIG.items(): context['config_values'].append( diff --git a/constance/templates/admin/constance/change_list.html b/constance/templates/admin/constance/change_list.html index 5149e866..0bfdb9ad 100644 --- a/constance/templates/admin/constance/change_list.html +++ b/constance/templates/admin/constance/change_list.html @@ -15,7 +15,9 @@ {{ block.super }} {{ media.js }} +{% if django_version < "5.1" %} +{% endif %} {% endblock %} {% block bodyclass %}{{ block.super }} change-list{% endblock %}