summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/forms/array.py
diff options
context:
space:
mode:
authorBrandon Chinn <brandonchinn178@gmail.com>2016-11-11 17:07:15 -0800
committerTim Graham <timograham@gmail.com>2016-11-15 18:10:45 -0500
commit6573274161ee589e89077192239e0bd01cbd692a (patch)
tree2c6ae810625958d7ed2d32be429af0bb6805b2af /django/contrib/postgres/forms/array.py
parent74ed20b49ade9f1cbd9af294e35478d8e0f59344 (diff)
Refs #27003 -- Fixed SimpleArrayField crash on converted values.
Diffstat (limited to 'django/contrib/postgres/forms/array.py')
-rw-r--r--django/contrib/postgres/forms/array.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/contrib/postgres/forms/array.py b/django/contrib/postgres/forms/array.py
index bd3daaae0b..d22d9081e2 100644
--- a/django/contrib/postgres/forms/array.py
+++ b/django/contrib/postgres/forms/array.py
@@ -35,7 +35,9 @@ class SimpleArrayField(forms.CharField):
return value
def to_python(self, value):
- if value:
+ if isinstance(value, list):
+ items = value
+ elif value:
items = value.split(self.delimiter)
else:
items = []