def save(self, commit=True):
        instance = super(OrgForm, self).save(commit=False)
        if 'issues' in self.fields:
            old_issues = instance.issues.all()
            new_issues = self.cleaned_data['issues']
            to_delete = set(old_issues) - set(new_issues)
            to_create = set(new_issues) - set(old_issues)

            OrgIssueRelationship.objects.filter(org=instance, issue__in=to_delete).delete()
            for issue in to_create:
                relationship = OrgIssueRelationship(org=instance, issue=issue)
                try:
                    relationship.full_clean()
                    relationship.save()
                except __HOLE__, e:
                    pass
            del(self.cleaned_data['issues'])
        if commit:
            instance.save()
            self.save_m2m()
        return instance
dataset/ETHPy150Open jumoconnect/openjumo/jumodjango/org/forms.py/OrgForm.save