diff options
| author | David Hoffman <me@davidhoffman.ca> | 2016-12-08 19:17:02 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-15 10:35:44 -0500 |
| commit | bf84d042e0bba636fe2199051fe25e96d89865da (patch) | |
| tree | 119470db1a6f0f6d5de6b66f71929c92a6a4e97f /django/contrib/postgres/forms | |
| parent | 9524fd9133e47fa90846904f81fe91c72f331e56 (diff) | |
Fixed #27582 -- Allowed HStoreField to store null values.
Diffstat (limited to 'django/contrib/postgres/forms')
| -rw-r--r-- | django/contrib/postgres/forms/hstore.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/contrib/postgres/forms/hstore.py b/django/contrib/postgres/forms/hstore.py index 4ed99d1fda..76d362999d 100644 --- a/django/contrib/postgres/forms/hstore.py +++ b/django/contrib/postgres/forms/hstore.py @@ -43,7 +43,9 @@ class HStoreField(forms.CharField): # Cast everything to strings for ease. for key, val in value.items(): - value[key] = six.text_type(val) + if val is not None: + val = six.text_type(val) + value[key] = val return value def has_changed(self, initial, data): |
