[Backport] Issue 2731: Using utf-8 chars in wiki titles
parent
3742e0c3cc
commit
e9879ee3a9
|
@ -19,6 +19,7 @@ from django.contrib.contenttypes import generic
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from taiga.base.utils.slug import slugify
|
||||||
from taiga.projects.notifications.mixins import WatchedModelMixin
|
from taiga.projects.notifications.mixins import WatchedModelMixin
|
||||||
from taiga.projects.occ import OCCModelMixin
|
from taiga.projects.occ import OCCModelMixin
|
||||||
|
|
||||||
|
@ -78,3 +79,9 @@ class WikiLink(models.Model):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
|
def save(self, *args, **kwargs):
|
||||||
|
if not self.href:
|
||||||
|
self.href = slugify(self.title)
|
||||||
|
|
||||||
|
super().save(*args, **kwargs)
|
||||||
|
|
|
@ -42,3 +42,4 @@ class WikiLinkSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.WikiLink
|
model = models.WikiLink
|
||||||
|
read_only_fields = ('href',)
|
||||||
|
|
Loading…
Reference in New Issue