Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 3.0 compatibility for Suit 1.x #751

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion suit/templates/admin/auth/user/change_password.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static admin_modify admin_urls %}
{% load i18n static admin_modify admin_urls %}
{% load url from suit_compat %}

{% block extrahead %}{{ block.super }}
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load admin_static %}{% load suit_tags %}{% load url from suit_compat %}<!DOCTYPE html>
{% load static %}{% load suit_tags %}{% load url from suit_compat %}<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/base_site.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/base.html" %}
{% load admin_static %}
{% load static %}

{# Additional <head> content here, some extra meta tags or favicon #}
{#{% block extrahead %}#}
Expand Down
6 changes: 3 additions & 3 deletions suit/templates/admin/change_form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static admin_modify suit_tags admin_urls %}
{% load i18n static admin_modify suit_tags admin_urls %}
{% load url from suit_compat %}

{% block extrahead %}{{ block.super }}
Expand Down Expand Up @@ -31,13 +31,13 @@
}(Suit.$))
</script>
{% endif %}

<script>
(function ($) {
$(function () {
$("#{% firstof opts.model_name opts.module_name %}_form").suit_form_debounce();
});
}(Suit.$))
}(Suit.$))
</script>

{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/change_list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static admin_list admin_urls suit_list suit_tags %}
{% load i18n static admin_list admin_urls suit_list suit_tags %}
{% load url from suit_compat %}

{% block extrastyle %}
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/change_list_results.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load i18n admin_static suit_list %}
{% load i18n static suit_list %}
{% if result_hidden_fields %}
<div class="hiddenfields">{# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/edit_inline/stacked.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load i18n admin_static admin_urls suit_tags %}
{% load i18n static admin_urls suit_tags %}
<div class="inline-group {{ inline_admin_formset.opts.suit_classes }}" id="{{ inline_admin_formset.formset.prefix }}-group">
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
{{ inline_admin_formset.formset.management_form }}
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/edit_inline/tabular.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load i18n admin_static admin_modify suit_tags admin_urls %}
{% load i18n static admin_modify suit_tags admin_urls %}
<div class="inline-group {{ inline_admin_formset.opts.suit_classes }}" id="{{ inline_admin_formset.formset.prefix }}-group">
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/import_export/base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static admin_modify %}
{% load i18n static admin_modify %}
{% load admin_urls %}
{% load url from suit_compat %}

Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static %}
{% load i18n static %}

{% block extrastyle %}
{{ block.super }}
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/login.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static suit_tags %}
{% load i18n static suit_tags %}
{% load url from suit_compat %}

{% block extrastyle %}{{ block.super }}
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/search_form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load i18n admin_static suit_list admin_list suit_tags %}
{% load i18n static suit_list admin_list suit_tags %}
{% if cl.search_fields or cl.has_filters %}
{% suit_bc_value 1.5 'pop' 1.6 '_popup' as POPUP_VAR %}
<div id="toolbar" class="clearfix">
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/suit/error_base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load admin_static i18n %}{% load url from suit_compat %}<!DOCTYPE html>
{% load static i18n %}{% load url from suit_compat %}<!DOCTYPE html>
<!--[if lt IE 9 ]><html lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en" xmlns="http://www.w3.org/1999/html"> <!--<![endif]-->
Expand Down
8 changes: 2 additions & 6 deletions suit/templatetags/suit_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
# For Django >= 2.0
from django.urls import reverse, resolve

try:
from django.utils.six import string_types
except ImportError:
# For Django < 1.4.2
string_types = basestring,
string_types = str,

import re
import warnings
Expand Down Expand Up @@ -46,7 +42,7 @@ def get_menu(context, request):
else:
try:
template_response = get_admin_site(context.current_app).index(request)
# Django 1.10 removed the current_app parameter for some classes and functions.
# Django 1.10 removed the current_app parameter for some classes and functions.
# Check the release notes.
except AttributeError:
template_response = get_admin_site(context.request.resolver_match.namespace).index(request)
Expand Down
2 changes: 1 addition & 1 deletion suit/tests/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
NumberInput, SuitDateWidget, SuitTimeWidget, SuitSplitDateTimeWidget, \
AutosizedTextarea
from django.utils.translation import ugettext as _
from django.contrib.admin.templatetags.admin_static import static
from django.templatetags.static import static
from suit import utils

django_version = utils.django_major_version()
Expand Down
2 changes: 1 addition & 1 deletion suit/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.utils.safestring import mark_safe
from django import forms
from django.utils.translation import ugettext as _
from django.contrib.admin.templatetags.admin_static import static
from django.templatetags.static import static

from suit import utils

Expand Down