use slugify function from django (#6826)

This commit is contained in:
Frédéric Péters 2015-03-25 14:24:39 +01:00
parent f89b1958d9
commit ae3961c354
3 changed files with 1 additions and 7 deletions

View File

@ -3,4 +3,3 @@ django-mellon
python-ldap
gadjo
requests
unidecode

View File

@ -76,7 +76,6 @@ setup(
'python-ldap',
'gadjo',
'requests',
'unidecode'
],
zip_safe=False,
cmdclass={

View File

@ -5,11 +5,11 @@ import xml.etree.ElementTree as etree
import requests
import urlparse
import re
import unidecode
import lasso
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils.text import slugify
def md_element_name(tag_name):
return '{%s}%s' % (lasso.SAML2_METADATA_HREF, tag_name)
@ -17,10 +17,6 @@ def md_element_name(tag_name):
def mdui_element_name(tag_name):
return '{%s}%s' % (SAML2_METADATA_UI_HREF, tag_name)
def slugify(text):
text = unidecode.unidecode(text).lower()
return re.sub(r'\W+', '-', text)
SAML2_METADATA_UI_HREF = 'urn:oasis:names:tc:SAML:metadata:ui'
ENTITY_DESCRIPTOR_TN = md_element_name('EntityDescriptor')
ENTITIES_DESCRIPTOR_TN = md_element_name('EntitiesDescriptor')