+ def clean(self):
+ super(StudentBaseFormSet, self).clean()
+ self.check_unique_emails()
+
+
+class StudentUpdateFormSet(StudentBaseFormSet):
+ takes_instance = True
+
+ def __init__(self, *args, **kwargs):
+ instance = kwargs.pop('instance', None)
+ super(StudentUpdateFormSet, self).__init__(*args, **kwargs)
+ self.instance = instance
+
+ def clean(self):
+ super(StudentUpdateFormSet, self).clean()
+ self.check_unique_emails()
+