From b7eb4387670152b27600b46fb9ff4373ee38e413 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 1 Jun 2022 13:14:45 +0200 Subject: [PATCH] fix migration datas --- .../migrations/versions/054a3aea9f08_transfer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/migrations/versions/054a3aea9f08_transfer.py b/ereuse_devicehub/migrations/versions/054a3aea9f08_transfer.py index d68fbe50..4a09b774 100644 --- a/ereuse_devicehub/migrations/versions/054a3aea9f08_transfer.py +++ b/ereuse_devicehub/migrations/versions/054a3aea9f08_transfer.py @@ -41,12 +41,12 @@ def upgrade_datas(): code = ac.code columns = '(id, user_from_id, user_to_id, lot_id, code)' values = f'(\'{id}\', \'{user_from}\', \'{user_to}\', \'{lot}\', \'{code}\')' - if user_from not in phantoms: - columns = '(id, user_to_id, lot_id, code)' - values = f'(\'{id}\', \'{user_to}\', \'{lot}\', \'{code}\')' if user_to not in phantoms: + columns = '(id, user_to_id, lot_id, code)' + values = f'(\'{id}\', \'{user_to}\', \'{lot}\', \'{code}\')' + if user_from not in phantoms: columns = '(id, user_from_id, lot_id, code)' - values = f'(\'{id}\', \'{user_from}\', \'{lot}\', \'{code}\')' + values = f'(\'{id}\', \'{user_from}\', \'{lot}\', \'{code}\')' new_transfer = f'insert into {get_inv()}.transfer {columns} values {values}' op.execute(new_transfer)