From 00812366a9ee346465d24fa76bdccaee70409c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexa=20Valentov=C3=A1?= <git@imaniti.org> Date: Thu, 12 Dec 2024 13:23:07 +0100 Subject: [PATCH] update file size limits --- main/forms.py | 4 ++-- main/templates/main/main_career_page.html | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main/forms.py b/main/forms.py index f01f1d9e..55bb85f2 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 = 25 * 1024 * 1024 # 25 MB + TOTAL_MAX_FILE_SIZE = 10 * 1024 * 1024 # 10 MB def clean(self, data, initial=None): single_file_clean = super().clean @@ -59,7 +59,7 @@ def validate_file_type(file): ) -def validate_file_size(file, max_size=10 * 1024 * 1024): # Default: 10 MB +def validate_file_size(file, max_size=5 * 1024 * 1024): # Default: 5 MB if file.size > max_size: raise ValidationError( f"Soubory mohou být max. {max_size / (1024 * 1024)} MB velké." diff --git a/main/templates/main/main_career_page.html b/main/templates/main/main_career_page.html index 060e80d3..be1372ec 100644 --- a/main/templates/main/main_career_page.html +++ b/main/templates/main/main_career_page.html @@ -86,7 +86,7 @@ {{ form.cv_file }} - <small class="text-grey-300">(Povinné, max. 10 MB)</small> + <small class="text-grey-300">(Povinné, max. 5 MB)</small> </section> <section class="flex flex-col gap-3 lg:items-center lg:flex-row"> <label @@ -97,7 +97,7 @@ {{ form.cover_letter_file }} - <small class="text-grey-300">(Povinný, max. 10 MB)</small> + <small class="text-grey-300">(Povinný, max. 5 MB)</small> </section> <section class="flex flex-col gap-3 lg:items-center lg:flex-row"> <label @@ -110,7 +110,7 @@ {{ form.other_files }} <small class="text-grey-300"> - (Max. 10 MB na jeden soubor, 25 MB celkem) + (Max. 5 MB na jeden soubor, 10 MB celkem) </small> </div> </section> -- GitLab