Auto slugify the wiki page slug input in the importer

remotes/origin/enhancement/email-actions
Jesús Espino 2014-10-17 10:01:20 +02:00
parent 742598a4f8
commit 35143a59e3
1 changed files with 3 additions and 0 deletions

View File

@ -16,7 +16,9 @@
import uuid
import os.path as path
from unidecode import unidecode
from django.template.defaultfilters import slugify
from django.contrib.contenttypes.models import ContentType
from taiga.projects.history.services import make_key_from_model_object
@ -229,6 +231,7 @@ def store_history(project, obj, history):
def store_wiki_page(project, wiki_page):
wiki_page['slug'] = slugify(unidecode(wiki_page['slug']))
serialized = serializers.WikiPageExportSerializer(data=wiki_page)
if serialized.is_valid():
serialized.object.project = project