Skip to content

Conversation

@emmanuel-ferdman
Copy link

PR summary:

Constant(None) was rejecting null values during load with "Field may not be null" because allow_none was being inferred before the constant value was assigned. Moving the default assignments before super().__init__(), lets the base class correctly infer allow_none=True when the constant is None.

Fixes #2868.

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Copy link
Member

@lafrech lafrech left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks!

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 this pull request may close these issues.

fields.Constant rejects None constant values during load

2 participants