Dashboard corrections

This commit is contained in:
2026-08-11 16:27:14 -04:00
parent 2d19bcdf60
commit 568dfbb91c
7 changed files with 85 additions and 13 deletions

View File

@@ -439,7 +439,11 @@ def dashboard_expiring():
machine = _related_machine(asset)
rows.append({
'assetid': asset.assetid,
'hostname': _hostname(asset) or asset.assetnumber or asset.name,
# Hostname, else the asset number - never asset.name. The name
# of a covered PC's ASSET is often the machine's descriptive name
# ("Haas VF-2"), so falling back to it put a machine name in a
# column that is supposed to identify the PC.
'hostname': _hostname(asset) or asset.assetnumber or str(asset.assetid),
'machinenumber': machine['machinenumber'] if machine else None,
'state': 'expired' if remaining < 0 else 'expiring',
'daysleft': remaining,