def clean(self):
        if any(self.errors):
            # Don't bother validating the formset unless each form is valid on
            # its own
            return
        # TODO: Notify user which forms were posted with same names (use
        # form._errors['name'] = ... )
        names = []
        for form in self.forms:
            name = form.cleaned_data['name']
            if name in names:
                raise forms.ValidationError(_("Statuses in a set must have "
                    "distinct name"))
            names.append(name)
Checks that no two statuses have the same name.
dataset/ETHPy150Open lukaszb/django-projector/projector/forms.py/BaseStatusFormSet.clean