let's see if unidecode can help here

This commit is contained in:
Thomas Steen Rasmussen 2016-08-08 21:47:53 +02:00
parent 7fa35f3300
commit 4e15a4c77b
2 changed files with 5 additions and 3 deletions

View file

@ -5,6 +5,7 @@ from django.utils.text import slugify
from utils.models import CreatedUpdatedModel from utils.models import CreatedUpdatedModel
from unidecode import unidecode
class EventType(CreatedUpdatedModel): class EventType(CreatedUpdatedModel):
""" Every event needs to have a type. """ """ Every event needs to have a type. """
@ -35,7 +36,7 @@ class Event(CreatedUpdatedModel):
def save(self, **kwargs): def save(self, **kwargs):
if not self.slug: if not self.slug:
self.slug = slugify(self.title) self.slug = slugify(unidecode(self.title))
super(Event, self).save(**kwargs) super(Event, self).save(**kwargs)
@ -60,6 +61,6 @@ class Speaker(CreatedUpdatedModel):
def save(self, **kwargs): def save(self, **kwargs):
if not self.slug: if not self.slug:
self.slug = slugify(self.name) self.slug = slugify(unidecode(self.name))
super(Speaker, self).save(**kwargs) super(Speaker, self).save(**kwargs)

View file

@ -7,4 +7,5 @@ PyPDF2>=1.25.1
django-wkhtmltopdf>=3.0.0 django-wkhtmltopdf>=3.0.0
Pillow==3.2.0 Pillow==3.2.0
qrcode==5.3 qrcode==5.3
CommonMark==0.6.4 CommonMark==0.6.4
Unidecode==0.4.19