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