python 12 fix syntax

This commit is contained in:
Your Name 2023-11-23 22:46:53 +00:00
parent 24b73da093
commit a0931dc088

View File

@ -28,13 +28,13 @@ def troggle_slugify(longname):
This function copied instact from troggle/parsers/people/py
"""
slug = longname.strip().lower().replace(" ","-")
slug = re.sub('\([^\)]*\)','',slug) # remove nickname in brackets
slug = re.sub(r'\([^\)]*\)','',slug) # remove nickname in brackets
slug = slug.replace('é', 'e')
slug = slug.replace('á', 'a')
slug = slug.replace('ä', 'a')
slug = slug.replace('&', '') # otherwise just remove the &
slug = slug.replace(';', '') # otherwise just remove the ;
slug = re.sub('<[^>]*>','',slug) # remove <span-lang = "hu">
slug = re.sub(r'<[^>]*>','',slug) # remove <span-lang = "hu">
if len(slug) > 40: # slugfield is 50 chars
slug = slug[:40]