From 42f81747a9ea9a96cf88ef310ddfefe18fdf2fb5 Mon Sep 17 00:00:00 2001
From: Parbhat Puri <parbhatpuri17@gmail.com>
Date: Thu, 28 Mar 2019 10:30:07 +0000
Subject: [PATCH] Add initial for group toggle with no choices

---
 opentech/apply/funds/models/applications.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/opentech/apply/funds/models/applications.py b/opentech/apply/funds/models/applications.py
index 847dfd1be..84c16c808 100644
--- a/opentech/apply/funds/models/applications.py
+++ b/opentech/apply/funds/models/applications.py
@@ -303,8 +303,11 @@ class RoundBase(WorkflowStreamForm, SubmittableStreamForm):  # type: ignore
                 for toggle_block_id, toggle_field in submission.group_toggle_blocks:
                     try:
                         initial_values[toggle_block_id] = toggle_field.value['choices'][0]
-                    except (KeyError, IndexError):
+                    except IndexError:
+                        initial_values[toggle_block_id] = 'yes'
+                    except KeyError:
                         pass
+
         except (submission_class.DoesNotExist, ValueError):
             pass
 
-- 
GitLab