Update ereuse_devicehub/inventory/forms.py

This commit is contained in:
Santiago L 2022-03-02 18:51:04 +01:00 committed by GitHub
parent eb84884db4
commit 473a7a02de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -724,9 +724,6 @@ class TradeForm(NewActionForm):
self.user_from.render_kw['data-email'] = g.user.email
self.user_to.render_kw['data-email'] = g.user.email
self._lot = (
# Lot.query.filter(Lot.id == self.lot.data)
# .filter(Lot.owner_id == g.user.id)
# .one()
Lot.query.outerjoin(Trade)
.filter(Lot.id == self.lot.data)
.filter(or_(Trade.user_from == g.user,