﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26557	GenericIPAddressField no longer normalises empty values to None	Joshua Phillips	nobody	"The `GenericIPAddressField` is documented to convert empty strings to `None` when saving models and when filtering and updating: ""If you allow for blank values, you have to allow for null values since blank values are stored as null.""

#24092 broke this:

{{{
-        return value or None
+        return connection.ops.value_to_db_ipaddress(value)
}}}
{{{
+    def value_to_db_ipaddress(self, value):
+        """"""
+        Transforms a string representation of an IP address into the expected
+        type for the backend driver.
+        """"""
+        return value
}}}

The default `value_to_db_ipaddress` function doesn't convert empty strings to None, like the code it replaced did. This is particularly important when using a `ModelForm`, since `forms.GenericIPAddressField` sets the model's field to an empty string if the field is not provided."	Bug	closed	Database layer (models, ORM)	1.8	Release blocker	fixed			Accepted	1	0	0	0	0	0
