diff --git a/main/forms.py b/main/forms.py index 55bb85f2b6c2609238ee7c18ac79b95a13fe347e..d3f378f459d8eed4c506488f3f745eab629f3085 100644 --- a/main/forms.py +++ b/main/forms.py @@ -19,7 +19,7 @@ class MultipleFileField(forms.FileField): kwargs.setdefault("widget", MultipleFileInput()) super().__init__(*args, **kwargs) - TOTAL_MAX_FILE_SIZE = 10 * 1024 * 1024 # 10 MB + TOTAL_MAX_FILE_SIZE = 5 * 1024 * 1024 # 5 MB def clean(self, data, initial=None): single_file_clean = super().clean diff --git a/main/models.py b/main/models.py index 9150089492cbb03e8381ef3b5ec49dfddced6c77..2735af40de6fe4a9ed07e435ec45cd0bd96ca491 100644 --- a/main/models.py +++ b/main/models.py @@ -557,7 +557,7 @@ CV, motivační dopis a ostatní soubory jsou v přílohách. Názvy souborů: Ostatní soubory: {other_files_names} -Při otevírání souborů buďte opatrní, virový sken neproběhl! +Při otevírání souborů buďte opatrní, virový proběhl, ale nemusí být přesný! """ ), # From email @@ -566,11 +566,14 @@ Při otevírání souborů buďte opatrní, virový sken neproběhl! self.recipient_emails.split(","), ) + form.cleaned_data["cv_file"].seek(0) email.attach( form.cleaned_data["cv_file"].name, form.cleaned_data["cv_file"].read(), form.cleaned_data["cv_file"].content_type, ) + + form.cleaned_data["cover_letter_file"].seek(0) email.attach( form.cleaned_data["cover_letter_file"].name, form.cleaned_data["cover_letter_file"].read(), @@ -578,6 +581,7 @@ Při otevírání souborů buďte opatrní, virový sken neproběhl! ) for file in form.cleaned_data["other_files"]: + file.seek(0) email.attach(file.name, file.read(), file.content_type) sent_successfully = email.send() diff --git a/main/templates/main/main_career_page.html b/main/templates/main/main_career_page.html index be1372ec180d1b75a33be3a04727b7c0c2acff6f..4e0f7f9f4c05f47ba8ac5bfd40201c9027e9b2e2 100644 --- a/main/templates/main/main_career_page.html +++ b/main/templates/main/main_career_page.html @@ -110,7 +110,7 @@ {{ form.other_files }} <small class="text-grey-300"> - (Max. 5 MB na jeden soubor, 10 MB celkem) + (Max. 5 MB na jeden soubor, 5 MB celkem) </small> </div> </section>