1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-11-26 21:27:11 +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 # Normalize side identifier, in order to remove accents
side_identifier = ''.join( side_identifier = ''.join(
char 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) if all(not unicodedata.category(char).startswith(cat)
for cat in {'M', 'P', 'Z', 'C'}) or char == ' ' for cat in {'M', 'P', 'Z', 'C'}) or char == ' '
).casefold().upper() ).casefold().upper()