﻿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
26251	SimpleArrayField missing clean method which leads to unexpected validation error.	Scott Allen	Scott Allen	"For reproduction and screenshot of admin error see: https://github.com/sgallen/django-simplearrayfield-bug

When a model field of the following form is used:
{{{ArrayField(models.IntegerField(choices=((0, 'foo'),(1, 'bar'))))}}}

The submission of a seemingly valid value e.g. {{{1}}} via the admin form leads to the unexpected message:
{{{Item 0 in the array did not validate:}}}

There is no additional message after the colon.

The cause of this error is a missing clean method in the {{{SimpleArrayField}}}.  As a result, there is no call to {{{self.base_field.clean(item)}}} which in this case is the {{{TypedChoiceField}}}.  Consequently the submitted string value is never coerced to an {{{int}}} and therefore the string comparison to the {{{int}}} choices will always fail.
"	Bug	closed	contrib.postgres	1.9	Normal	duplicate	postgres, arrayfield, simplearrayfield	michaelvantellingen@…	Accepted	0	0	0	0	0	0
