bugfix: restriction delete lot by the owner

This commit is contained in:
Cayo Puigdefabregas 2021-06-02 10:11:20 +02:00
parent 57c9269907
commit 20e029b359

View file

@ -109,7 +109,7 @@ class LotView(View):
return query
def delete(self, id):
lot = Lot.query.filter_by(id=id,).one()
lot = Lot.query.filter_by(id=id, owner=g.user).one()
lot.delete()
db.session.commit()
return Response(status=204)