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)