[PR #11722] [MERGED] Fixes #11459 - Allow using null in conditions #13829

Closed
opened 2025-12-29 23:21:02 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11722
Author: @kkthxbye-code
Created: 2/10/2023
Status: Merged
Merged: 2/13/2023
Merged by: @jeremystretch

Base: developHead: 11459


📝 Commits (2)

📊 Changes

3 files changed (+15 additions, -4 deletions)

View changed files

📝 docs/reference/conditions.md (+3 -3)
📝 netbox/extras/conditions.py (+2 -1)
📝 netbox/extras/tests/test_conditions.py (+10 -0)

📄 Description

Fixes: #11459

Issue here was two-fold I believe. First issue is that primary_ip is always None when evaluating the conditions as computed properties are not serialized when queuing webhooks.

The other issue is that comparing "" with None is False. Allowing conditions to contain null/None allows to compare against None instead of empty string which was not functional.


🔄 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/11722 **Author:** [@kkthxbye-code](https://github.com/kkthxbye-code) **Created:** 2/10/2023 **Status:** ✅ Merged **Merged:** 2/13/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `11459` --- ### 📝 Commits (2) - [`90d5950`](https://github.com/netbox-community/netbox/commit/90d595066df7292c1c1786e8b97eda6e280c503e) Fixes #11459 - Allow using null in conditions - [`7e493f2`](https://github.com/netbox-community/netbox/commit/7e493f2935c3d41bdd658d368ff985ac0b4d9837) Update netbox/extras/conditions.py ### 📊 Changes **3 files changed** (+15 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/reference/conditions.md` (+3 -3) 📝 `netbox/extras/conditions.py` (+2 -1) 📝 `netbox/extras/tests/test_conditions.py` (+10 -0) </details> ### 📄 Description ### Fixes: #11459 Issue here was two-fold I believe. First issue is that primary_ip is always None when evaluating the conditions as computed properties are not serialized when queuing webhooks. The other issue is that comparing "" with None is False. Allowing conditions to contain `null`/`None` allows to compare against None instead of empty string which was not functional. --- <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-29 23:21:02 +01:00
adam closed this issue 2025-12-29 23:21:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13829