[PR #19820] [CLOSED] 19633 fix in condition aval #15727

Closed
opened 2025-12-30 00:23:40 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19820
Author: @ravenrs
Created: 7/7/2025
Status: Closed

Base: mainHead: 19633-fix-in-condition-aval


📝 Commits (3)

  • 2f9e1ce Fixes #19633. Added new test cases to handle cases where the field being compared (x) doesn't exist in the data dictionary, which would result in None when trying to access it, and you want these comparisons to safely return False rather than raising an error.
  • 8c87975 Fixes #19633. Handle case that was the reason of TypeError and raise exeption: "TypeError: argument of type 'NoneType' is not iterable" with lead to breaking all events in the same object_type.
  • 675eefc Fixes #18159 fix PEP8 compliance error of previous commit in test_conditions.py

📊 Changes

2 files changed (+57 additions, -27 deletions)

View changed files

📝 netbox/extras/conditions.py (+7 -1)
📝 netbox/extras/tests/test_conditions.py (+50 -26)

📄 Description

Fixes: #19633

Fixed the ValueError error that appeared in the status evaluation function when the value is None, it may be an error on the attribute path. I also added tests to cover this case. All of them were completed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19820 **Author:** [@ravenrs](https://github.com/ravenrs) **Created:** 7/7/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `19633-fix-in-condition-aval` --- ### 📝 Commits (3) - [`2f9e1ce`](https://github.com/netbox-community/netbox/commit/2f9e1cee048c70ab18f2fe72dd12d95bfc40dd26) Fixes #19633. Added new test cases to handle cases where the field being compared (x) doesn't exist in the data dictionary, which would result in None when trying to access it, and you want these comparisons to safely return False rather than raising an error. - [`8c87975`](https://github.com/netbox-community/netbox/commit/8c8797599baa1601af52c6f8b570026ea840fcc2) Fixes #19633. Handle case that was the reason of TypeError and raise exeption: "TypeError: argument of type 'NoneType' is not iterable" with lead to breaking all events in the same object_type. - [`675eefc`](https://github.com/netbox-community/netbox/commit/675eefc30142b0a5c43946c9a44b26b610f4c9dd) Fixes #18159 fix PEP8 compliance error of previous commit in test_conditions.py ### 📊 Changes **2 files changed** (+57 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/conditions.py` (+7 -1) 📝 `netbox/extras/tests/test_conditions.py` (+50 -26) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #19633 Fixed the ValueError error that appeared in the status evaluation function when the value is None, it may be an error on the attribute path. I also added tests to cover this case. All of them were completed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:23:40 +01:00
adam closed this issue 2025-12-30 00:23:41 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15727