Skip to content

Conversation

@fabi125
Copy link
Contributor

@fabi125 fabi125 commented Mar 10, 2025

Fixes: #18838

Reject falsy values like the empty string, 0 or False as local context data.

I verified that None/null still works as expected and that an empty string in UI gets correctly converted to None before clean() is called.

@jnovinger jnovinger requested review from a team and jnovinger and removed request for a team March 10, 2025 23:04
@jnovinger jnovinger changed the title Correctly reject invalid falsy local context data. Fixes #18838: Correctly reject invalid falsy local context data Mar 10, 2025
Copy link
Member

@jnovinger jnovinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change does the trick. However, let's move the tests to be as close to the code change as possible.

Copy link
Contributor Author

@fabi125 fabi125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Tests moved.

Copy link
Member

@jnovinger jnovinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fabi125 !

@jnovinger jnovinger merged commit 19d1282 into netbox-community:main Mar 11, 2025
3 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local Context Data can be set to non-none falsy values

2 participants