mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-10-31 15:50:03 +01:00 
			
		
		
		
	🎨 Normalize - to _ since these characters are used a lot
This commit is contained in:
		| @@ -247,7 +247,8 @@ class Alias(models.Model): | ||||
|         Normalizes a string: removes most diacritics, does casefolding and ignore non-ASCII characters | ||||
|         """ | ||||
|         return ''.join( | ||||
|             char for char in unicodedata.normalize('NFKD', string.casefold().replace('æ', 'ae').replace('œ', 'oe')) | ||||
|             char for char in unicodedata.normalize('NFKD', string.casefold().replace('æ', 'ae') | ||||
|                                                    .replace('œ', 'oe').replace('-', '_')) | ||||
|             if all(not unicodedata.category(char).startswith(cat) | ||||
|                    for cat in {'M', 'P', 'Z', 'C'})).casefold().encode('ascii', 'ignore').decode('ascii') | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user