mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 09:42:10 +01:00 
			
		
		
		
	A motivation letter must be a PDF/JPEG/PNG file (it didn't work)
This commit is contained in:
		@@ -61,7 +61,7 @@ class ParticipationForm(forms.ModelForm):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class MotivationLetterForm(forms.ModelForm):
 | 
					class MotivationLetterForm(forms.ModelForm):
 | 
				
			||||||
    def clean_file(self):
 | 
					    def clean_file(self):
 | 
				
			||||||
        if "file" in self.files:
 | 
					        if "motivation_letter" in self.files:
 | 
				
			||||||
            file = self.files["motivation_letter"]
 | 
					            file = self.files["motivation_letter"]
 | 
				
			||||||
            if file.size > 2e6:
 | 
					            if file.size > 2e6:
 | 
				
			||||||
                raise ValidationError(_("The uploaded file size must be under 2 Mo."))
 | 
					                raise ValidationError(_("The uploaded file size must be under 2 Mo."))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user