

def open_target_group_for_form(self, form):
    '\n        Makes sure that the first group that should be open is open.\n        This is either the first group with errors or the first group\n        in the container, unless that first group was originally set to\n        active=False.\n        '
    target = self.first_container_with_errors(form.errors.keys())
    if (target is None):
        target = self.fields[0]
        if (not target._active_originally_included):
            target.active = True
        return target
    target.active = True
    return target

dataset/ETHPy150Open maraujop/django-crispy-forms/crispy_forms/bootstrap.py ContainerHolder.open_target_group_for_form/original