Project

General

Profile

« Previous | Next » 

Revision 03b73cdc

Added by Serghei Mihai over 9 years ago

slugify dependency replaced by local function

View differences:

uauth/organization/management/commands/sync_federations.py
4 4
import xml.etree.ElementTree as etree
5 5
import requests
6 6
import urlparse
7

  
7
import re
8
import unidecode
8 9
import lasso
9
from slugify import slugify
10 10

  
11 11
from django.conf import settings
12 12
from django.core.management.base import BaseCommand, CommandError
......
17 17
def mdui_element_name(tag_name):
18 18
    return '{%s}%s' % (SAML2_METADATA_UI_HREF, tag_name)
19 19

  
20
def slugify(text):
21
    text = unidecode.unidecode(text).lower()
22
    return re.sub(r'\W+', '-', text)
23

  
20 24
SAML2_METADATA_UI_HREF = 'urn:oasis:names:tc:SAML:metadata:ui'
21 25
ENTITY_DESCRIPTOR_TN = md_element_name('EntityDescriptor')
22 26
ENTITIES_DESCRIPTOR_TN = md_element_name('EntitiesDescriptor')

Also available in: Unified diff