diff --git a/opentech/apply/stream_forms/blocks.py b/opentech/apply/stream_forms/blocks.py index 18d0502d5a725e8883805122fdb866e8121badfb..4167e6a0d5166b5ce980a4f85a1a8d40a5a12a4f 100644 --- a/opentech/apply/stream_forms/blocks.py +++ b/opentech/apply/stream_forms/blocks.py @@ -210,10 +210,11 @@ class GroupToggleBlock(FormFieldBlock): (choice, choice) for choice in struct_value['choices'] ] - if len(field_choices) > 2: + total_choices = len(field_choices) + if total_choices > 2: # For toggle we need only two choices field_choices = field_choices[:2] - elif len(field_choices) < 2: + elif total_choices < 2: field_choices = [ ('yes', 'Yes'), ('no', 'No'),