1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-12-24 17:42:23 +00:00

Clean code

This commit is contained in:
Yohann D'ANELLO 2020-02-10 17:07:06 +01:00
parent 8dbf0494c2
commit 11f0eff4d4

View File

@ -116,7 +116,8 @@ class MediaAdminForm(ModelForm):
# Normalize side identifier, in order to remove accents
side_identifier = ''.join(
char
for char in unicodedata.normalize('NFKD', side_identifier.casefold())
for char in unicodedata.normalize(
'NFKD', side_identifier.casefold())
if all(not unicodedata.category(char).startswith(cat)
for cat in {'M', 'P', 'Z', 'C'}) or char == ' '
).casefold().upper()