Opened 10 years ago
Closed 10 years ago
#24078 closed Bug (fixed)
GenericIPAddressField is inconsistent with nulls
Reported by: | Josh Smeaton | Owned by: | Josh Smeaton |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
IP Addresses are stored as inet on postgres, so the empty string isn't allowed. Instead, any empty strings are converted to nulls.
Oracle will then convert that null to the empty string once it's retrieved, because GenericIPAddressField.empty_strings_allowed = True. Other backends will return None.
I think the right thing to do is set empty_strings_allowed = False on GenericIPAddressField, but I'm not sure if that'll have other implications. I'll put together a patch later today.
Change History (4)
comment:1 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Ready for checkin |
comment:3 by , 10 years ago
All bug fixes are backwards incompatible by nature, I don't think release notes are required here.
LGTM.
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
See PR https://github.com/django/django/pull/3840
Not sure if release notes are required, or if this could be considered a backwards incompatible change.