'Create verticals for any missing groups in the split test instance.
Called from Studio view.'

@XBlock.handler
def add_missing_groups(self, request, suffix=''):

    user_partition = self.get_selected_partition()
    changed = False
    for group in user_partition.groups:
        str_group_id = unicode(group.id)
        if (str_group_id not in self.group_id_to_child):
            user_id = self.runtime.service(self, 'user').get_current_user().opt_attrs['edx-platform.user_id']
            self._create_vertical_for_group(group, user_id)
            changed = True
    if changed:
        self.system.modulestore.update_item(self, None)
    return Response()
