Esempio n. 1
0
 def clean_file(self):
     return validate_mime(
         self.cleaned_data['file'],
         ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
          'application/octet-stream', 'application/zip', 'application/vnd.ms-excel'],
         'Please upload a valid XLSX file'
     )
Esempio n. 2
0
 def clean_course_assessment(self):
     return validate_mime(
         self.cleaned_data['course_assessment'],
         ['application/pdf'],
         _('Please upload a valid PDF')
     )
Esempio n. 3
0
 def clean_enrollment_certificate(self):
     return validate_mime(
         self.cleaned_data['enrollment_certificate'],
         ['application/pdf'],
         _('Please upload a valid PDF file')
     )
Esempio n. 4
0
 def clean_cv(self):
     return validate_mime(
         self.cleaned_data['cv'],
         ['application/pdf'],
         _('Please upload a valid PDF file')
     )
Esempio n. 5
0
 def clean_profile_image(self):
     return validate_mime(
         self.cleaned_data['profile_image'],
         ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'],
         _('Please upload a valid JPG, PNG or GIF profile image')
     )