Skip to content

Commit

Permalink
fix allow_unicode kwarg for AutoSlugField (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky authored Mar 5, 2019
1 parent e37d983 commit b58eca2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions djangocms_blog/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

class AutoSlugField(SlugField):
def __init__(self, *args, **kwargs):
self.allow_unicode = kwargs.pop('allow_unicode', False)
super(SlugField, self).__init__(*args, **kwargs)
if django.VERSION < (1, 9):
self.allow_unicode = kwargs.pop('allow_unicode', False)
super(AutoSlugField, self).__init__(*args, **kwargs)


def slugify(base):
Expand Down
21 changes: 21 additions & 0 deletions djangocms_blog/migrations/0036_auto_20180913_1809.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-13 18:09
from __future__ import unicode_literals

from django.db import migrations
import djangocms_blog.fields


class Migration(migrations.Migration):

dependencies = [
('djangocms_blog', '0035_posttranslation_subtitle'),
]

operations = [
migrations.AlterField(
model_name='posttranslation',
name='slug',
field=djangocms_blog.fields.AutoSlugField(allow_unicode=True, blank=True, max_length=767, verbose_name='slug'),
),
]

0 comments on commit b58eca2

Please sign in to comment.