# HG changeset patch # User Daniel Diniz # Date 1246627304 -7200 # Node ID 4a6b8d6674b672cac5579940069b3efa28ae1b2d # Parent c98bf890156e58d0a0af3d73ebcbf5f1e552182b Fix pick_multi only returning one answer as maximum. Reviewed by: Lennard de Rijk diff -r c98bf890156e -r 4a6b8d6674b6 app/soc/views/helper/surveys.py --- a/app/soc/views/helper/surveys.py Fri Jul 03 15:00:00 2009 +0200 +++ b/app/soc/views/helper/surveys.py Fri Jul 03 15:21:44 2009 +0200 @@ -139,6 +139,9 @@ else: extra_attrs['disabled'] = 'disabled' + # flag whether we can use getlist to retrieve multiple values + is_post = hasattr(post_dict, 'getlist') + # add unordered fields to self.survey_fields for field in self.survey_content.dynamic_properties(): @@ -150,7 +153,10 @@ if has_record and field in post_dict: # entered value that is not yet saved - value = post_dict[field] + if schema.getType(field) == 'pick_multi' and is_post: + value = post_dict.getlist(field) + else: + value = post_dict[field] if COMMENT_PREFIX + field in post_dict: comment = post_dict[COMMENT_PREFIX + field] elif has_record and hasattr(self.survey_record, field):