Exemplo n.º 1
0
    def clean_file(self):
        f = self.cleaned_data['file']
        
        file_name = os.path.basename(f.name)
        
        if not fileNameCheck(file_name, extentions_list):
            raise forms.ValidationError("Filename contains unsupported characters")
        
        if default_storage.exists(os.path.join(settings.S3_INPUT_HGS, f.name)):
            raise forms.ValidationError("Uploading file '%s' already exists in the system" % f.name)

        return f
Exemplo n.º 2
0
 def clean_file(self):
     f = self.cleaned_data['file']
     
     file_name = os.path.basename(f.name)
     
     if not fileNameCheck(file_name, extentions_list):
         raise forms.ValidationError("Something is wrong with the filename or archive type")
     
     if default_storage.exists(os.path.join(settings.S3_INPUT, f.name)):
         raise forms.ValidationError("Uploading file '%s' already exists in the system" % f.name)
     
     return f