diff --git a/wcs/forms/root.py b/wcs/forms/root.py index 0d34bb547..63d342146 100644 --- a/wcs/forms/root.py +++ b/wcs/forms/root.py @@ -383,6 +383,12 @@ class FormPage(Directory, FormTemplateMixin): if not isinstance(v, str) and field.convert_value_to_str: v = field.convert_value_to_str(v) form.get_widget('f%s' % k).set_value(v) + if field.type == 'item' and form.get_widget('f%s' % k).value != v: + # mark field as invalid if the value was not accepted + # (this is required by quixote>=3 as the value would + # not be evaluated in the initial GET request of the + # page). + form.get_widget('f%s' % k).set_error(get_selection_error_text()) if verified: form.get_widget('f%s' % k).readonly = 'readonly' form.get_widget('f%s' % k).attrs['readonly'] = 'readonly'