From a1728810d12b767c1cab19eaa15c216e5fe340e2 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 30 May 2022 17:35:27 +0200 Subject: [PATCH] fixed bugs --- ereuse_devicehub/inventory/forms.py | 1 + ereuse_devicehub/inventory/views.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index d2107d92..a6f5efd4 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -1169,6 +1169,7 @@ class EditTransferForm(TransferForm): ) def __init__(self, *args, **kwargs): + # import pdb;pdb.set_trace() super().__init__(*args, **kwargs) del self.type diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 978b02d0..4a526db7 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -54,7 +54,7 @@ class DeviceListMix(GenericMixView): if lot_id: lot = lots.filter(Lot.id == lot_id).one() if not lot.is_temporary and lot.transfer: - form_transfer = EditTransferForm(lot_id=lot.id, id=lot.transfer.id) + form_transfer = EditTransferForm(lot_id=lot.id) form_new_action = NewActionForm(lot=lot_id) self.context.update( @@ -412,7 +412,7 @@ class NewTransferView(GenericMixView): self.form.save() new_lot_id = lot_id if self.form.newlot.id: - new_lot_id = self.form.newlot.id + new_lot_id = "{}".format(self.form.newlot.id) Lot.query.filter(Lot.id == new_lot_id).one() messages.success('Transfer created successfully!') next_url = url_for('inventory.lotdevicelist', lot_id=new_lot_id)