Compare commits
2 Commits
f793bd01e1
...
1808c3e8fb
| Author | SHA1 | Date | |
|---|---|---|---|
| 1808c3e8fb | |||
| 971cf8d6b6 |
@@ -307,11 +307,12 @@ def checkout(user, barcode, loc=None):
|
|||||||
loc = None
|
loc = None
|
||||||
if itm:
|
if itm:
|
||||||
itm.checkout = True
|
itm.checkout = True
|
||||||
|
if user is not False:
|
||||||
itm.checkout_user = user
|
itm.checkout_user = user
|
||||||
itm.checkout_loc = loc
|
itm.checkout_loc = loc
|
||||||
itm.save()
|
itm.save()
|
||||||
itmdict = item.select().where(item.barcode==itm.barcode).dicts()[0]
|
itmdict = item.select().where(item.barcode==itm.barcode).dicts()[0]
|
||||||
itmdict["location"] = fancy_location(item.select().where(item.barcode==itm["barcode"])[0].loc)
|
itmdict["location"] = fancy_location(item.select().where(item.barcode==itmdict["barcode"])[0].loc)
|
||||||
search.add_document(itmdict)
|
search.add_document(itmdict)
|
||||||
return itm
|
return itm
|
||||||
else:
|
else:
|
||||||
@@ -324,12 +325,13 @@ def checkin(user, barcode, loc=None):
|
|||||||
if itm:
|
if itm:
|
||||||
print("Found", itm.fullname)
|
print("Found", itm.fullname)
|
||||||
itm.checkout = False
|
itm.checkout = False
|
||||||
|
if user is not False:
|
||||||
itm.last_user = user
|
itm.last_user = user
|
||||||
if loc is not None:
|
if loc is not None:
|
||||||
itm.loc = loc
|
itm.loc = loc
|
||||||
itm.save()
|
itm.save()
|
||||||
itmdict = item.select().where(item.barcode==itm.barcode).dicts()[0]
|
itmdict = item.select().where(item.barcode==itm.barcode).dicts()[0]
|
||||||
itmdict["location"] = fancy_location(item.select().where(item.barcode==itm["barcode"])[0].loc)
|
itmdict["location"] = fancy_location(item.select().where(item.barcode==itmdict["barcode"])[0].loc)
|
||||||
search.add_document(itmdict)
|
search.add_document(itmdict)
|
||||||
return itm
|
return itm
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user