Skip to content

Commit

Permalink
fix(checkouts): fix db check filters (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
drahamim authored Mar 14, 2024
1 parent cf72b20 commit 5f89ae8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/invenflask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,17 @@ def checkout():
flash('Staff and or Asset fields are required', "warning")

if not db.session.query(Asset).filter(
func.lower(id) == asset_id.lower()).scalar():
func.lower(Asset.id) == asset_id.lower()).scalar():
flash('Asset does not exist', "warning")
return render_template('checkout.html')

if not db.session.query(Staff).filter(
func.lower(id) == staff_id.lower()).scalar():
func.lower(Staff.id) == staff_id.lower()).scalar():
flash('Staff does not exist', "warning")
return render_template('checkout.html')

if not db.session.query(Asset).filter(
func.lower(id) == accessory_id.lower()
func.lower(Asset.id) == accessory_id.lower()
).scalar() and accessory_id != '':
flash('Accessory does not exist', "warning")
return render_template('checkout.html')
Expand Down

0 comments on commit 5f89ae8

Please sign in to comment.