Skip to content

Commit b2f0f79

Browse files
committed
Merge remote-tracking branch 'origin/develop' into custom-admin-namespace
Conflicts: cms/templates/cms/toolbar/plugin.html
2 parents 003207e + a794063 commit b2f0f79

File tree

9 files changed

+241
-18
lines changed

9 files changed

+241
-18
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ django CMS
44
.. image:: https://api.travis-ci.org/divio/django-cms.svg?branch=develop
55
:target: http://travis-ci.org/divio/django-cms
66
.. image:: https://pypip.in/v/django-cms/badge.svg
7-
:target: https://crate.io/packages/django-cms/
7+
:target: https://pypi.python.org/pypi/django-cms/
88
.. image:: https://pypip.in/d/django-cms/badge.svg
9-
:target: https://crate.io/packages/django-cms/
9+
:target: https://pypi.python.org/pypi/django-cms/
1010
.. image:: https://pypip.in/wheel/django-cms/badge.svg
1111
:target: https://pypi.python.org/pypi/django-cms/
1212
.. image:: https://pypip.in/license/django-cms/badge.svg

cms/migrations/0068_auto__chg_field_placeholder_slot.py

Lines changed: 209 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import models, migrations
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('cms', '0001_initial'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='placeholder',
16+
name='slot',
17+
field=models.CharField(verbose_name='slot', max_length=255, editable=False, db_index=True),
18+
),
19+
]

cms/models/placeholdermodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
@python_2_unicode_compatible
2020
class Placeholder(models.Model):
21-
slot = models.CharField(_("slot"), max_length=50, db_index=True, editable=False)
21+
slot = models.CharField(_("slot"), max_length=255, db_index=True, editable=False)
2222
default_width = models.PositiveSmallIntegerField(_("width"), null=True, editable=False)
2323
cache_placeholder = True
2424

cms/plugin_pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def register_plugin(self, plugin):
7171
# TemplateDoesNotExist if the plugin's render_template
7272
# does in fact exist, but it includes a template that
7373
# doesn't.
74-
if e.message == template:
74+
if six.text_type(e) == template:
7575
raise ImproperlyConfigured(
7676
"CMS Plugins must define a render template (%s) that exists: %s"
7777
% (plugin, template)

cms/templates/cms/toolbar/plugin.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
'onClose': {% if refresh_page %}'REFRESH_PAGE'{% else %}{% if redirect_on_close %}'{{ redirect_on_close }}'{% else %}false{% endif %}{% endif %},
2323
'urls': {
2424
'add_plugin': '{% if add_url %}{{ add_url }}{% else %}{% cms_admin_url "cms_page_add_plugin" %}}{% endif %}',
25-
'edit_plugin': '{% if edit_url %}{{ edit_url }}{% else %}{% cms_admin_url "cms_page_edit_plugin" instance.pk %}{% endif %}',
25+
'edit_plugin': '{% if edit_url %}{{ edit_url }}{% elif instance %}{% cms_admin_url "cms_page_edit_plugin" instance.pk %}{% endif %}',
2626
'move_plugin': '{% if move_url %}{{ move_url }}{% else %}{% cms_admin_url "cms_page_move_plugin" %}{% endif %}',
27-
'delete_plugin': '{% if delete_url %}{{ delete_url }}{% else %}{% cms_admin_url "cms_page_delete_plugin" instance.pk %}{% endif %}',
27+
'delete_plugin': '{% if delete_url %}{{ delete_url }}{% elif instance %}{% cms_admin_url "cms_page_delete_plugin" instance.pk %}{% endif %}',
2828
'copy_plugin': '{% cms_admin_url "cms_page_copy_plugins" %}'
2929
} {% endlanguage %}
3030
});
3131
});
3232
})(CMS.$);
3333
</script>{% endaddtoblock %}
34-
{% endspaceless %}
34+
{% endspaceless %}

cms/templatetags/cms_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def get_processors(self, context, plugin):
362362
def get_context(self, context, plugin):
363363
if not plugin:
364364
return {'content': ''}
365-
365+
366366
processors=self.get_processors(context, plugin)
367367

368368
return {'content': plugin.render_plugin(context, processors=processors)}

cms/test_utils/util/static_analysis.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
from pyflakes.checker import Checker
66
from pyflakes.reporter import Reporter
77

8-
import cms
9-
import menus
10-
118

129
def _pyflakes_report_with_nopyflakes(self, messageClass, node, *args, **kwargs):
1310
with open(self.filename, 'r') as code:
@@ -35,7 +32,7 @@ def _check_recursive(paths, reporter):
3532
return num_warnings
3633

3734

38-
def pyflakes():
35+
def pyflakes(packages):
3936
"""
4037
Unfortunately, pyflakes does not have a way to suppress certain errors or
4138
a way to configure the checker class, so we have to monkey patch it.
@@ -46,9 +43,5 @@ def pyflakes():
4643
Checker.__init__ = _pyflakes_no_migrations
4744
Checker.report = _pyflakes_report_with_nopyflakes
4845
reporter = Reporter(sys.stdout, sys.stderr)
49-
paths = [
50-
os.path.abspath(os.path.dirname(cms.__file__)),
51-
os.path.abspath(os.path.dirname(menus.__file__)),
52-
os.path.abspath(__file__),
53-
]
46+
paths = [os.path.dirname(package.__file__) for package in packages]
5447
return _check_recursive(paths, reporter)

cms/tests/static_analysis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ class AboveStaticAnalysisCodeTest(TestCase):
77
Name is pretty lame, but ensure it's executed before every other test
88
"""
99
def test_pyflakes(self):
10-
self.assertEqual(pyflakes(), 0)
10+
import cms
11+
import menus
12+
self.assertEqual(pyflakes((cms, menus)), 0)

0 commit comments

Comments
 (0)