Commit 0c41535c authored by Thibaud Lasguignes's avatar Thibaud Lasguignes
Browse files

Offices - Update and ALIAS as list

update for the changement of manager
change ALIAS from a dict of pairs to a dict of list of pairs. credits to @nim65s.
parent a7450abf
......@@ -7,14 +7,6 @@
[
"Fourmy",
"Médéric"
],
[
"Nicolin",
"Alexis"
],
[
"Ramuzat",
"Noelie"
]
],
"B185": [
......@@ -99,8 +91,14 @@
"Côme"
],
[
"Romualdi",
"Giulio"
"Smaldone",
"Filippo Maria"
]
],
"B68": [
[
"Deves",
"Mathieu"
]
],
"B69.1": [
......@@ -110,10 +108,6 @@
]
],
"B69.2": [
[
"Ha",
"Thuc Long"
],
[
"Kleff",
"Sébastien"
......@@ -140,9 +134,23 @@
"Lamiraux",
"Florent"
],
[
"Le",
"Quang Anh"
],
[
"Mansard",
"Nicolas"
]
],
"BSalleGerardBauzil": [
[
"Depledt",
"Yann"
],
[
"Nguyen",
"Dinh Vinh Thanh"
]
]
}
\ No newline at end of file
......@@ -84,18 +84,20 @@ class Offices:
# Stuff that is wrong in LDAP… We should fix that there
WRONG_OFFICE = {
'Exterieur': {('Steve', 'Tonneau'), ('Nils', 'Hareng')},
'Exterieur': {('Nils', 'Hareng')},
'BSalleGerardBauzil': {('Quang Anh', 'Le')},
'B69.1': {('Guilhem', 'Saurel'), ('Pierre', 'Fernbach')},
'B90': {('Nicolas', 'Mansard')},
'B69.2': {('D. V. Thanh', 'Nguyen')},
'B69.2': {('Dinh Vinh Thanh', 'Nguyen'), ('Filip', 'Becanovic')},
}
WRONG_OFFICE = {k: {Gepettist(sn, gn) for (gn, sn) in v} for k, v in WRONG_OFFICE.items()}
# Fix unicode from LDAP data…
ALIAS = {
'B67': ({Gepettist('Leziart', 'Pierre-Alexandre')}, {Gepettist('Léziart', 'P-A')}),
'B61a': ({Gepettist('Taix', 'Michel')}, {Gepettist('Taïx', 'Michel')}),
'B91': ({Gepettist('Soueres', 'Philippe')}, {Gepettist('Souères', 'Philippe')}),
'B181': ({Gepettist('Ramuzat', 'Noelie')}, {Gepettist('Ramuzat', 'Noëlie')}),
'B67': [({Gepettist('Leziart', 'Pierre-Alexandre')}, {Gepettist('Léziart', 'P-A')}),
({Gepettist('Smaldone', 'Filippo Maria')}, {Gepettist('Smaldone', 'Filippo M.')})],
'B61a': [({Gepettist('Taix', 'Michel')}, {Gepettist('Taïx', 'Michel')})],
'B91': [({Gepettist('Soueres', 'Philippe')}, {Gepettist('Souères', 'Philippe')})],
'B69.2': [({Gepettist('Nguyen', 'Dinh Vinh Thanh')}, {Gepettist('Nguyen', 'D. V. T.')})],
}
......@@ -143,8 +145,10 @@ def fix_wrong_offices(offices):
for wrong_office in offices:
if wrong_office != woffice:
offices[wrong_office] -= wmembers # remove them from the other offices
for office, (before, after) in ALIAS.items():
offices[office] = offices[office] - before | after
for office, aliases in ALIAS.items():
for (before, after) in aliases:
print(f"Fixing: office {office}: {before}, {after}")
offices[office] = offices[office] - before | after
return offices
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment