smal: last_seen_ts can be empty
This commit is contained in:
parent
0136565ed8
commit
ce6ed0977e
1 changed files with 5 additions and 1 deletions
|
|
@ -58,8 +58,12 @@ def e2eesetup(mxpassfile):
|
||||||
# print(device)
|
# print(device)
|
||||||
if device["device_id"] != whoami["device_id"]:
|
if device["device_id"] != whoami["device_id"]:
|
||||||
other_devices_list.append(device["device_id"])
|
other_devices_list.append(device["device_id"])
|
||||||
|
# devices never logged in don't have a 'last_seen_ts'
|
||||||
|
last_seen = ""
|
||||||
|
if device["last_seen_ts"]:
|
||||||
|
last_seen = datetime.fromtimestamp(device["last_seen_ts"] / 1000)
|
||||||
click.echo(
|
click.echo(
|
||||||
f" {device['device_id']} ({device['display_name']}) - {datetime.fromtimestamp(device['last_seen_ts']/1000)} from {device['last_seen_ip']}"
|
f" {device['device_id']} ({device['display_name']}) - {last_seen} from {device['last_seen_ip']}"
|
||||||
)
|
)
|
||||||
click.echo()
|
click.echo()
|
||||||
if click.confirm("Do you want to log them out?"):
|
if click.confirm("Do you want to log them out?"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue