From 18fc0e6e5b3a01784bf34e037c134d84945a1c8a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 12 Jan 2022 19:44:10 +0100 Subject: [PATCH] add lots in create or update lot views --- ereuse_devicehub/inventory/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index fa89c769..3c9099e7 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -77,7 +77,8 @@ class LotCreateView(View): next_url = url_for('inventory.devices.lotdevicelist', id=form.instance.id) return flask.redirect(next_url) - return flask.render_template(self.template_name, form=form, title=self.title) + lots = Lot.query.filter(Lot.owner_id == current_user.id) + return flask.render_template(self.template_name, form=form, title=self.title, lots=lots) class LotUpdateView(View): @@ -93,7 +94,8 @@ class LotUpdateView(View): next_url = url_for('inventory.devices.lotdevicelist', id=id) return flask.redirect(next_url) - return flask.render_template(self.template_name, form=form, title=self.title) + lots = Lot.query.filter(Lot.owner_id == current_user.id) + return flask.render_template(self.template_name, form=form, title=self.title, lots=lots) class LotDeleteView(View):