From ae3961c35487756aeba8564d1d646358fc228769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 25 Mar 2015 14:24:39 +0100 Subject: [PATCH] use slugify function from django (#6826) --- requirements.txt | 1 - setup.py | 1 - uauth/organization/management/commands/sync_federations.py | 6 +----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3bd9718..e01e6b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,3 @@ django-mellon python-ldap gadjo requests -unidecode diff --git a/setup.py b/setup.py index 24f49ee..ddee862 100644 --- a/setup.py +++ b/setup.py @@ -76,7 +76,6 @@ setup( 'python-ldap', 'gadjo', 'requests', - 'unidecode' ], zip_safe=False, cmdclass={ diff --git a/uauth/organization/management/commands/sync_federations.py b/uauth/organization/management/commands/sync_federations.py index e750bb6..4525ea2 100644 --- a/uauth/organization/management/commands/sync_federations.py +++ b/uauth/organization/management/commands/sync_federations.py @@ -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') -- 2.1.4