Permalink
Browse files

Dropped support for Django < 1.11

  • Loading branch information...
czpython committed Feb 6, 2018
1 parent db8b1ef commit 967b838d06ec1138de752899b1987298cb44becb
@@ -4,7 +4,6 @@ python:
- 3.6
- 3.5
- 3.4
- 3.3
- 2.7
sudo: false
@@ -41,22 +40,7 @@ env:
- DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- TEST_DOCS=1 DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
- DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
- DJANGO=1.10 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- DJANGO=1.9 DATABASE_URL='sqlite://localhost/:memory:'
- DJANGO=1.9 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- DJANGO=1.8 DATABASE_URL='sqlite://localhost/:memory:'
- DJANGO=1.8 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- TEST_DOCS=1 DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
before_script:
- pip freeze
@@ -99,96 +83,8 @@ notifications:
matrix:
exclude:
- python: 2.7
env: TEST_DOCS=1 DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
- python: 2.7
env: DJANGO=1.11 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 2.7
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 2.7
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 2.7
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 2.7
env: DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
- python: 2.7
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 2.7
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 2.7
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 2.7
env: DJANGO=1.9 DATABASE_URL='sqlite://localhost/:memory:'
- python: 2.7
env: DJANGO=1.9 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 2.7
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 2.7
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 2.7
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=1 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 2.7
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=2 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 2.7
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=3 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 2.7
env: FRONTEND=1 UNIT=1
- python: 2.7
env: FRONTEND=1 LINT=1
- python: 3.3
env: TEST_DOCS=1 DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.3
env: DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.3
env: DJANGO=1.11 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.3
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.3
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.3
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.3
env: DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.3
env: DJANGO=1.10 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.3
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.3
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.3
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.3
env: DJANGO=1.9 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.3
env: DJANGO=1.9 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.3
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.3
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.3
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.3
env: DJANGO=1.8 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.3
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.3
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.3
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.3
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=1 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 3.3
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=2 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 3.3
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=3 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 3.3
env: FRONTEND=1 UNIT=1
- python: 3.3
env: FRONTEND=1 LINT=1
- python: 3.4
env: TEST_DOCS=1 DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
env: TEST_DOCS=1 DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.4
env: DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.4
@@ -199,32 +95,6 @@ matrix:
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.4
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.4
env: DJANGO=1.10 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.4
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.4
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.4
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.4
env: DJANGO=1.9 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.4
env: DJANGO=1.9 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.4
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.4
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.4
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.4
env: DJANGO=1.8 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.4
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.4
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.4
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.4
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=1 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 3.4
@@ -236,68 +106,25 @@ matrix:
- python: 3.4
env: FRONTEND=1 LINT=1
- python: 3.6
env: TEST_DOCS=1 DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.6
- python: 3.5
env: TEST_DOCS=1 DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.5
env: DJANGO=1.11 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.6
- python: 3.5
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.6
- python: 3.5
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.6
- python: 3.5
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.6
env: DJANGO=1.10 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.6
env: DJANGO=1.10 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.6
env: DJANGO=1.10 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.6
env: DJANGO=1.9 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.6
env: DJANGO=1.9 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.6
env: DJANGO=1.9 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.6
env: DJANGO=1.8 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.6
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.6
env: DJANGO=1.8 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.6
- python: 3.5
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=1 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 3.6
- python: 3.5
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=2 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 3.6
- python: 3.5
env: FRONTEND=1 INTEGRATION=1 INTEGRATION_TESTS_BUCKET=3 DJANGO=1.11 DATABASE_URL='sqlite://localhost/testdb.sqlite'
- python: 3.6
- python: 3.5
env: FRONTEND=1 UNIT=1
- python: 3.6
env: FRONTEND=1 LINT=1
allow_failures:
- python: 2.7
env: DJANGO=1.8 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.4
env: DJANGO=1.8 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.5
env: DJANGO=1.8 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=1.8 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
env: FRONTEND=1 LINT=1
fast_finish: true
@@ -1,6 +1,7 @@
=== 3.6.0 (unreleased) ===
* Removed the ``cms moderator`` command.
* Dropped Django < 1.11 support.
=== 3.5.2 (2018-04-11) ===
@@ -13,7 +13,6 @@
from cms.apphook_pool import apphook_pool
from cms.models.pagemodel import Page
from cms.utils import get_current_site
from cms.utils.compat import DJANGO_1_8, DJANGO_1_9
from cms.utils.i18n import get_language_list
APP_RESOLVERS = []
@@ -117,18 +116,11 @@ def recurse_patterns(path, pattern_list, page_id, default_args=None,
args = pattern.default_kwargs
if default_args:
args.update(default_args)
if DJANGO_1_8:
# this is an 'include', recurse!
resolver = RegexURLResolver(regex, 'cms_appresolver',
pattern.default_kwargs, pattern.app_name, pattern.namespace)
# see lines 243 and 236 of urlresolvers.py to understand the next line
resolver._urlconf_module = recurse_patterns(regex, pattern.url_patterns, page_id, args, nested=True)
else:
# see lines 243 and 236 of urlresolvers.py to understand the next line
urlconf_module = recurse_patterns(regex, pattern.url_patterns, page_id, args, nested=True)
# this is an 'include', recurse!
resolver = RegexURLResolver(regex, urlconf_module,
pattern.default_kwargs, pattern.app_name, pattern.namespace)
# see lines 243 and 236 of urlresolvers.py to understand the next line
urlconf_module = recurse_patterns(regex, pattern.url_patterns, page_id, args, nested=True)
# this is an 'include', recurse!
resolver = RegexURLResolver(regex, urlconf_module,
pattern.default_kwargs, pattern.app_name, pattern.namespace)
else:
# Re-do the RegexURLPattern with the new regular expression
args = pattern.default_args
@@ -149,10 +141,7 @@ def _set_permissions(patterns, exclude_permissions):
_set_permissions(pattern.url_patterns, exclude_permissions)
else:
from cms.utils.decorators import cms_perms
if DJANGO_1_9:
pattern._callback = cms_perms(pattern.callback)
else:
pattern.callback = cms_perms(pattern.callback)
pattern.callback = cms_perms(pattern.callback)
def get_app_urls(urls):
@@ -8,7 +8,6 @@
from cms.api import get_page_draft
from cms.apphook_pool import apphook_pool
from cms.models import EmptyTitle
from cms.utils.compat import DJANGO_1_9
from cms.utils.conf import get_cms_setting
from cms.utils.i18n import (
get_fallback_languages,
@@ -249,14 +248,7 @@ def get_nodes(self, request):
to_attr='filtered_translations',
queryset=titles,
)
if DJANGO_1_9:
# This function was made public in django 1.10
# and as a result its signature changed
prefetch_related_objects(pages, [lookup])
else:
prefetch_related_objects(pages, lookup)
prefetch_related_objects(pages, lookup)
# Build the blank title instances only once
blank_title_cache = {language: EmptyTitle(language=language) for language in languages}
@@ -1,13 +1,11 @@
# -*- coding: utf-8 -*-
from cms.utils.compat import DJANGO_1_10
from django.contrib.auth import get_permission_codename
from django.contrib.sites.models import Site
from django.core.urlresolvers import NoReverseMatch, reverse_lazy
from django.forms.widgets import Select, MultiWidget, TextInput
from django.utils.encoding import force_text
from django.utils.html import escape, escapejs
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from cms.utils.urlutils import admin_reverse, static_with_version
from cms.forms.utils import get_site_choices, get_page_choices
@@ -95,33 +93,6 @@ def get_context(self, name, value, attrs):
context['widget']['script_init'] = self._build_script(name, value, context['widget']['attrs'])
return context
def render(self, name, value, attrs=None, renderer=None):
if DJANGO_1_10:
# THIS IS A COPY OF django.forms.widgets.MultiWidget.render()
# (except for the last line)
# value is a list of values, each corresponding to a widget
# in self.widgets.
self._build_widgets()
if not isinstance(value, list):
value = self.decompress(value)
output = []
final_attrs = self.build_attrs(attrs)
id_ = final_attrs.get('id', None)
for i, widget in enumerate(self.widgets):
try:
widget_value = value[i]
except IndexError:
widget_value = None
if id_:
final_attrs = dict(final_attrs, id='%s_%s' % (id_, i))
output.append(widget.render(name + '_%s' % i, widget_value, final_attrs))
output.append(self._build_script(name, value, final_attrs))
return mark_safe(self.format_output(output))
else:
return super(PageSelectWidget, self).render(name, value, attrs, renderer)
def format_output(self, rendered_widgets):
return u' '.join(rendered_widgets)
@@ -176,15 +147,6 @@ def get_context(self, name, value, attrs):
context['widget']['script_init'] = self._build_script(name, value, context['widget']['attrs'])
return context
def render(self, name, value, attrs=None, renderer=None):
if DJANGO_1_10:
final_attrs = self.build_attrs(attrs)
output = list(self._build_script(name, value, final_attrs))
output.append(super(PageSmartLinkWidget, self).render(name, value, attrs))
return mark_safe(u''.join(output))
else:
return super(PageSmartLinkWidget, self).render(name, value, attrs, renderer)
class UserSelectAdminWidget(Select):
"""Special widget used in page permission inlines, because we have to render
@@ -298,16 +260,3 @@ def get_context(self, name, value, attrs):
context = super(ApplicationConfigSelect, self).get_context(name, value, attrs)
context['widget']['script_init'] = self._build_script(name, value, context['widget']['attrs'])
return context
def render(self, name, value, attrs=None, renderer=None):
if DJANGO_1_10:
output = list(super(ApplicationConfigSelect, self).render(name, value, attrs))
output.append(self._build_script(name, value, attrs))
related_url = ''
output.append('<a href="%s" class="add-another" id="add_%s" title="%s" onclick="return showAddAnotherPopup(this);">'
% (related_url, name, _('Add Another')))
output.append('</a>')
return mark_safe(''.join(output))
else:
return super(ApplicationConfigSelect, self).render(name, value, attrs, renderer)
Oops, something went wrong.

0 comments on commit 967b838

Please sign in to comment.