Skip to content

Remove support for assigning None to a SplitField#614

Merged
foarsitter merged 1 commit intojazzband:masterfrom
ProtixIT:splitfield-notnone
Jun 13, 2024
Merged

Remove support for assigning None to a SplitField#614
foarsitter merged 1 commit intojazzband:masterfrom
ProtixIT:splitfield-notnone

Conversation

@mthuurne
Copy link
Contributor

This behavior wasn't documented and didn't fully work: it breaks as soon as you try to save a model with a None value.

I think removing None support is better than making it work:

  • to make it work properly, it would have to respect the null constructor argument both in the implementation and in the type checking, which is a lot of work
  • the Django docs recommend against using null=True for text fields, so the value of the feature is questionable

As it was an undocumented feature that only partially worked, I think this change doesn't break backwards compatibility, so I didn't add it to the ChangeLog.

This behavior wasn't documented and didn't fully work: it breaks
as soon as you try to save a model with a `None` value.
@mthuurne mthuurne mentioned this pull request Apr 16, 2024
@foarsitter
Copy link
Contributor

With 73,057 Downloads last day* you are at least breaking someones code. But since it is undocumented and not working properly I'm not against it.

*https://pypistats.org/packages/django-model-utils

@mthuurne
Copy link
Contributor Author

Does that mean the PR is fine as it is or should I add a line to the ChangeLog?

@foarsitter
Copy link
Contributor

That is up to you, I don't have an opinion on this one.

@foarsitter
Copy link
Contributor

@gmcrocetti what is your opinion on this one?

@mthuurne mthuurne mentioned this pull request Jun 12, 2024
@foarsitter foarsitter merged commit 4275f84 into jazzband:master Jun 13, 2024
@mthuurne mthuurne deleted the splitfield-notnone branch June 13, 2024 10:02
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.

2 participants