USB external import, and filter chips on health-dot cards
This commit is contained in:
@@ -87,7 +87,10 @@ def _checkout_events(checkout):
|
||||
'device_id': checkout.device.serialnumber if checkout.device else None,
|
||||
'action': 'check-in',
|
||||
'timestamp': checkout.checkintime.isoformat() + 'Z',
|
||||
'scanned_viruses': None,
|
||||
# Both read from the checkout row now. scanned_viruses was
|
||||
# hardcoded None: the shape promised the field and had nowhere to
|
||||
# read it from, so an imported history would have shown blank.
|
||||
'scanned_viruses': checkout.scannedviruses,
|
||||
'locker_location': None,
|
||||
'sanitized': checkout.waswiped,
|
||||
})
|
||||
@@ -233,6 +236,10 @@ def checkin_device(device_id, data):
|
||||
checkintime = override
|
||||
open_checkout.checkintime = checkintime
|
||||
open_checkout.waswiped = bool(data.get('sanitized'))
|
||||
# None, not False, when the caller said nothing: an unrecorded scan is
|
||||
# not a failed scan, and an audit reads those very differently.
|
||||
scanned = data.get('scanned_viruses')
|
||||
open_checkout.scannedviruses = None if scanned is None else bool(scanned)
|
||||
open_checkout.checkinnotes = data.get('notes')
|
||||
device.ischeckedout = False
|
||||
device.currentuserid = None
|
||||
|
||||
Reference in New Issue
Block a user