fix 500 on creating groups

fixes bug introduced by commit d9697c29
Merge pull request #2312 from dimagi/hotfix-groups

fix 500 on creating groups