use slugify function from django (#6826)
This commit is contained in:
parent
f89b1958d9
commit
ae3961c354
|
@ -3,4 +3,3 @@ django-mellon
|
|||
python-ldap
|
||||
gadjo
|
||||
requests
|
||||
unidecode
|
||||
|
|
1
setup.py
1
setup.py
|
@ -76,7 +76,6 @@ setup(
|
|||
'python-ldap',
|
||||
'gadjo',
|
||||
'requests',
|
||||
'unidecode'
|
||||
],
|
||||
zip_safe=False,
|
||||
cmdclass={
|
||||
|
|
|
@ -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')
|
||||
|
|
Reference in New Issue