Skip to content

Commit

Permalink
Merge pull request #4698 from yakky/merge/4329
Browse files Browse the repository at this point in the history
Merge #4329
  • Loading branch information
yakky committed Dec 3, 2015
2 parents 4f46462 + 756cf4e commit 3e58004
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
=== 3.3.0 (Unreleased) ===

* Removed support for Django 1.6, 1.7 and python 2.6
* Set the default value of CMSPlugin.position to 0 instead of null

=== 3.2.1 (Unreleased) ===

- Fixed an issue with refreshing the UI when switching CMS language
Expand Down
19 changes: 19 additions & 0 deletions cms/migrations/0014_auto_20151111_2359.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('cms', '0013_urlconfrevision'),
]

operations = [
migrations.AlterField(
model_name='cmsplugin',
name='position',
field=models.PositiveSmallIntegerField(default=0, verbose_name='position', editable=False),
),
]
2 changes: 1 addition & 1 deletion cms/models/pluginmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class CMSPlugin(six.with_metaclass(PluginModelBase, MP_Node)):
'''
placeholder = models.ForeignKey(Placeholder, editable=False, null=True)
parent = models.ForeignKey('self', blank=True, null=True, editable=False)
position = models.PositiveSmallIntegerField(_("position"), blank=True, null=True, editable=False)
position = models.PositiveSmallIntegerField(_("position"), default = 0, editable=False)
language = models.CharField(_("language"), max_length=15, blank=False, db_index=True, editable=False)
plugin_type = models.CharField(_("plugin_name"), max_length=50, db_index=True, editable=False)
creation_date = models.DateTimeField(_("creation date"), editable=False, default=timezone.now)
Expand Down
2 changes: 1 addition & 1 deletion cms/tests/test_nested_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def test_plugin_fix_tree(self):

original_plugins = (placeholder.get_plugins().order_by('position', 'path'))

CMSPlugin.objects.update(position=None)
CMSPlugin.objects.update(position=0)
CMSPlugin.fix_tree()

new_plugins = list(placeholder.get_plugins().order_by('position', 'path'))
Expand Down

0 comments on commit 3e58004

Please sign in to comment.