app/soc/logic/cleaning.py
changeset 2115 fafd021def7e
parent 2073 6eb9b4652c80
child 2327 6c7d0fba105c
equal deleted inserted replaced
2114:1b3830abcdf7 2115:fafd021def7e
   587         del cleaned_data['organization']
   587         del cleaned_data['organization']
   588 
   588 
   589     return cleaned_data
   589     return cleaned_data
   590   return wrapper
   590   return wrapper
   591 
   591 
   592 def validate_new_student_project(org_field, mentor_field, student_field):
   592 def validate_student_project(org_field, mentor_field, student_field):
   593   """Validates the form of a student proposal.
   593   """Validates the form of a student proposal.
   594 
   594 
   595   Args:
   595   Args:
   596     org_field: Field containing key_name for org
   596     org_field: Field containing key_name for org
   597     mentor_field: Field containing the link_id of the mentor
   597     mentor_field: Field containing the link_id of the mentor
   598     student_field: Field containing the student link_id
   598     student_field: Field containing the student link_id
   599 
   599 
   600   Raises ValidationError if:
   600   Raises ValidationError if:
   601     -A valid Organization does not exist for the given keyname
   601     -A valid Organization does not exist for the given keyname
   602     -The mentor link_id does not match the mentors for the active organization
   602     -The mentor link_id does not match a mentor for the active organization
   603     -The student link_id does not match a student in the org's Program
   603     -The student link_id does not match a student in the org's Program
   604   """
   604   """
   605 
   605 
   606   def wrapper(self):
   606   def wrapper(self):
   607     """Decorator wrapper method.
   607     """Decorator wrapper method.