Example #1
0
    def validate(self, attrs):
        """ This modifies self.instance in the case of updates """
        if not self.instance:
            enrollment = ProgramEnrollment(**attrs)
            enrollment.full_clean()
        else:
            for key, value in attrs.items():
                setattr(self.instance, key, value)
            self.instance.full_clean()

        return attrs
    def validate(self, attrs):
        """ This modifies self.instance in the case of updates """
        if not self.instance:
            enrollment = ProgramEnrollment(**attrs)
            enrollment.full_clean()
        else:
            for key, value in attrs.items():
                setattr(self.instance, key, value)
            self.instance.full_clean()

        return attrs
Example #3
0
 def validate(self, attrs):
     enrollment = ProgramEnrollment(**attrs)
     enrollment.full_clean()
     return attrs
 def validate(self, attrs):
     enrollment = ProgramEnrollment(**attrs)
     enrollment.full_clean()
     return attrs