Merge pull request #338 from nephila/merge/0.8.9

Forwardport 0.8.9
This commit is contained in:
Iacopo Spalletti 2016-10-29 18:30:26 +02:00 committed by GitHub
commit 19872a711a
5 changed files with 10 additions and 2 deletions

View file

@ -22,10 +22,11 @@ History
* Improved admin filtering.
******************
0.8.9 (unreleased)
0.8.9 (2016-10-25)
******************
* Optimized querysets
* Fixed slug generation in wizard
******************
0.8.8 (2016-09-04)

View file

@ -3,6 +3,6 @@ from __future__ import absolute_import, print_function, unicode_literals
__author__ = 'Iacopo Spalletti'
__email__ = 'i.spalletti@nephila.it'
__version__ = '0.9b4'
__version__ = '0.9b5'
default_app_config = 'djangocms_blog.apps.BlogAppConfig'

View file

@ -243,6 +243,8 @@ class Post(KnockerModel, ModelMeta, TranslatableModel):
"""
if self.publish and self.date_published is None:
self.date_published = timezone.now()
if not self.slug and self.title:
self.slug = slugify(self.title)
super(Post, self).save(*args, **kwargs)
def save_translation(self, translation, *args, **kwargs):

View file

@ -548,6 +548,10 @@ class ModelsTest(BaseTest):
self.assertEqual(new_category.count_all_sites, 1)
self.assertEqual(self.category_1.count_all_sites, 2)
def test_slug(self):
post = Post.objects.language('en').create(title='I am a title')
self.assertEqual(post.slug, 'i-am-a-title')
def test_model_attributes(self):
self.get_pages()

View file

@ -9,6 +9,7 @@ deps =
django18: django-filer<1.3
django18: cmsplugin-filer<1.2
django18: django-haystack
django18: djangocms-admin-style>1.2,<1.3
django19: Django>=1.9,<1.10
django19: django-mptt>=0.8
django19: django-filer<1.3