clean urls

This commit is contained in:
j 2021-11-24 11:47:25 +01:00
parent 896b46a1a1
commit c562f87059

View file

@ -8,7 +8,9 @@ def escape(key):
return key.replace('%', '%25').replace('&', '%26').replace('_', '%09').replace(' ', '_').replace('<', '%0E').replace('>', '%0F') return key.replace('%', '%25').replace('&', '%26').replace('_', '%09').replace(' ', '_').replace('<', '%0E').replace('>', '%0F')
def escape_slug(key): def escape_slug(key):
return key.replace('%', '').replace('&', '-').replace('_', '-').replace(' ', '-').replace('<', '').replace('>', '').lower() key = ox.decode_html(key).replace('%', '').replace('&', '-').replace('_', '-').replace(' ', '-').replace('<', '').replace('>', '').lower()
key = key.replace("'", '').replace('"', '').strip()
return key
class Command(BaseCommand): class Command(BaseCommand):
help = 'import titles from pan.do/ra' help = 'import titles from pan.do/ra'