Skip to content

Commit

Permalink
fix: django 5.1 removed collapse.js (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotzbua authored Jun 14, 2024
1 parent ba530b9 commit 5f262fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion constance/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions constance/templates/admin/constance/change_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
{{ block.super }}
{{ media.js }}
<script type="text/javascript" src="{% static 'admin/js/constance.js' %}"></script>
{% if django_version < "5.1" %}
<script type="text/javascript" src="{% static 'admin/js/collapse.js' %}"></script>
{% endif %}
{% endblock %}

{% block bodyclass %}{{ block.super }} change-list{% endblock %}
Expand Down

0 comments on commit 5f262fc

Please sign in to comment.