ArnesSI / netbox-inventory

Manage your hardware inventory in NetBox
MIT License
205 stars 21 forks source link

Warranty division by zero #135

Closed wols closed 9 months ago

wols commented 12 months ago

Error

<class 'ZeroDivisionError'>

division by zero

Python version: 3.11.5
NetBox version: 3.6.3
Plugins: 
  netbox_attachments: 3.0.1
  netbox_inventory: 1.5.1

Changelog:

Difference

{
    "purchase": null,
    "warranty_end": null,
    "warranty_start": null
}
{
    "purchase": 11,
    "warranty_end": "2011-02-16",
    "warranty_start": "2011-02-16"
}

Probably a date difference of at least one should be required?

Manual fixed: update netbox_inventory_asset set warranty_end = '2013-02-16' where purchase = 11;

matejv commented 12 months ago

Could you let me know on which URL did this error occur?

wols commented 12 months ago

Sorry, I updated an asset: /plugins/inventory/assets/ID/edit/ and added the purchase and warranty date.