Skip to content
Snippets Groups Projects
Commit 00812366 authored by Alexa Valentová's avatar Alexa Valentová
Browse files

update file size limits

parent c274d7a5
Branches
No related tags found
2 merge requests!1208Release,!1201Release career template test
Pipeline #20309 passed
...@@ -19,7 +19,7 @@ class MultipleFileField(forms.FileField): ...@@ -19,7 +19,7 @@ class MultipleFileField(forms.FileField):
kwargs.setdefault("widget", MultipleFileInput()) kwargs.setdefault("widget", MultipleFileInput())
super().__init__(*args, **kwargs) 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): def clean(self, data, initial=None):
single_file_clean = super().clean single_file_clean = super().clean
...@@ -59,7 +59,7 @@ def validate_file_type(file): ...@@ -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: if file.size > max_size:
raise ValidationError( raise ValidationError(
f"Soubory mohou být max. {max_size / (1024 * 1024)} MB velké." f"Soubory mohou být max. {max_size / (1024 * 1024)} MB velké."
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
{{ form.cv_file }} {{ 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>
<section class="flex flex-col gap-3 lg:items-center lg:flex-row"> <section class="flex flex-col gap-3 lg:items-center lg:flex-row">
<label <label
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
{{ form.cover_letter_file }} {{ 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>
<section class="flex flex-col gap-3 lg:items-center lg:flex-row"> <section class="flex flex-col gap-3 lg:items-center lg:flex-row">
<label <label
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
{{ form.other_files }} {{ form.other_files }}
<small class="text-grey-300"> <small class="text-grey-300">
(Max. 10 MB na jeden soubor, 25 MB celkem) (Max. 5 MB na jeden soubor, 10 MB celkem)
</small> </small>
</div> </div>
</section> </section>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment