From c43e7fb578d759ff9d4543b2abd4fea39a070dfd Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 16 Jun 2022 11:47:36 +0200 Subject: [PATCH] fix splits texts --- .../8d4fe4b497b3_add_system_uuid_to_old_registers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/migrations/versions/8d4fe4b497b3_add_system_uuid_to_old_registers.py b/ereuse_devicehub/migrations/versions/8d4fe4b497b3_add_system_uuid_to_old_registers.py index db363a4c..7be10975 100644 --- a/ereuse_devicehub/migrations/versions/8d4fe4b497b3_add_system_uuid_to_old_registers.py +++ b/ereuse_devicehub/migrations/versions/8d4fe4b497b3_add_system_uuid_to_old_registers.py @@ -47,7 +47,13 @@ def upgrade(): system_uuids_file = 'system_uuids.csv' if os.path.exists(system_uuids_file): with open(system_uuids_file) as f: - uuids = [x.split(';') for x in f.read().split('\n')] + for x in f.read().split('\n'): + z = x.split(';') + if len(z) != 2: + continue + + x, y = z + uuids.append([x.strip(), y.strip()]) con = op.get_bind() for u in uuids[1:]: