From ffdf609b566057b7377df805c3eea970994e9f16 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Mon, 13 Mar 2023 23:17:55 +0100 Subject: [PATCH] Small fixes in migrate.py --- wgmaster/migrate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wgmaster/migrate.py b/wgmaster/migrate.py index 5d5d898..41951ea 100755 --- a/wgmaster/migrate.py +++ b/wgmaster/migrate.py @@ -226,7 +226,7 @@ def migrate_branches(in_dir: str, out_dir: str) -> None: with open(f'{out_dir}/branch.csv', 'w+') as f: f.write('zwstid;name;country;postal_dest;address;phone_nr\n') for b in csv.parse(f'{in_dir}/TZweigstellen.csv'): - BRANCH_MAP[b['ZNR']] = b['Kennbst'] + BRANCH_MAP[b['ZNR']] = b['Kennbst'].strip().title() address = b['Straße'] postal_dest = lookup_plz(int(b['PLZ']) if b['PLZ'] else None, b['Ort'], address) f.write(csv.format_row(b['Kennbst'], b['Name'], 'AT', postal_dest, address, b['Telefon'])) @@ -491,7 +491,8 @@ def migrate_members(in_dir: str, out_dir: str) -> None: invalid(mgnr, 'Tel.Nr.', m['Mobiltelefon']) else: if phone_2[3] == '6': - phone_mobile.append(phone_2) + if phone_2 not in phone_mobile: + phone_mobile.append(phone_2) elif phone_landline is None: phone_landline = phone_2 elif phone_landline != phone_2: