Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warranty division by zero #135

Closed
wols opened this issue Oct 11, 2023 · 2 comments · Fixed by #140
Closed

Warranty division by zero #135

wols opened this issue Oct 11, 2023 · 2 comments · Fixed by #140
Assignees

Comments

@wols
Copy link

wols commented Oct 11, 2023

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 matejv self-assigned this Oct 11, 2023
@matejv
Copy link
Member

matejv commented Oct 11, 2023

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

@wols
Copy link
Author

wols commented Oct 11, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants