diff --git a/scripts/data/offices-ldap.json b/scripts/data/offices-ldap.json index 7ecfc758cdb4f8a1aa2e2a84ebff9fa9ee4eee7b..b1c8c20250fb84794249658271603f97cb8fae8e 100644 --- a/scripts/data/offices-ldap.json +++ b/scripts/data/offices-ldap.json @@ -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 diff --git a/scripts/offices.py b/scripts/offices.py index 5ed10b70aee086be0bb9b5fc9584e0925542c2d6..98ab2b03526743a07d94ed2d77fb7b15dd0a4a82 100755 --- a/scripts/offices.py +++ b/scripts/offices.py @@ -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,9 @@ 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: + offices[office] = offices[office] - before | after return offices