diff --git a/src/open_inwoner/openzaak/migrations/0006_auto_20230123_1619.py b/src/open_inwoner/openzaak/migrations/0006_auto_20230123_1619.py new file mode 100644 index 0000000000..3006b7fbe8 --- /dev/null +++ b/src/open_inwoner/openzaak/migrations/0006_auto_20230123_1619.py @@ -0,0 +1,53 @@ +# Generated by Django 3.2.15 on 2023-01-23 15:19 + +from django.db import migrations, models +import django_better_admin_arrayfield.models.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("openzaak", "0005_openzaakconfig_zaak_max_confidentiality"), + ] + + operations = [ + migrations.AddField( + model_name="openzaakconfig", + name="allowed_file_extensions", + field=django_better_admin_arrayfield.models.fields.ArrayField( + base_field=models.CharField( + max_length=8, verbose_name="Allowed file extensions" + ), + default=[ + "pdf", + "doc", + "docx", + "xls", + "xlsx", + "ppt", + "pptx", + "vsd", + "png", + "gif", + "jpg", + "tiff", + "msg", + "txt", + "rtf", + "jpeg", + "bmp", + ], + help_text="A list of the allowed file extensions.", + size=None, + ), + ), + migrations.AddField( + model_name="openzaakconfig", + name="max_upload_size", + field=models.PositiveIntegerField( + default=50, + help_text="The max size of the file (in MB) which is uploaded.", + verbose_name="Max upload file size (in MB)", + ), + ), + ] diff --git a/src/open_inwoner/openzaak/models.py b/src/open_inwoner/openzaak/models.py index ee370434b7..3a672a8f04 100644 --- a/src/open_inwoner/openzaak/models.py +++ b/src/open_inwoner/openzaak/models.py @@ -1,6 +1,7 @@ from django.db import models from django.utils.translation import gettext_lazy as _ +from django_better_admin_arrayfield.models.fields import ArrayField from solo.models import SingletonModel from zgw_consumers.api_models.constants import VertrouwelijkheidsAanduidingen from zgw_consumers.constants import APITypes @@ -50,6 +51,37 @@ class OpenZaakConfig(SingletonModel): verbose_name=_("Documents confidentiality"), help_text=_("Select confidentiality level of documents to display for cases"), ) + max_upload_size = models.PositiveIntegerField( + verbose_name=_("Max upload file size (in MB)"), + default=50, + help_text=_("The max size of the file (in MB) which is uploaded."), + ) + allowed_file_extensions = ArrayField( + models.CharField( + verbose_name=_("Allowed file extensions"), + max_length=8, + ), + default=[ + "pdf", + "doc", + "docx", + "xls", + "xlsx", + "ppt", + "pptx", + "vsd", + "png", + "gif", + "jpg", + "tiff", + "msg", + "txt", + "rtf", + "jpeg", + "bmp", + ], + help_text=_("A list of the allowed file extensions."), + ) class Meta: verbose_name = _("Open Zaak configuration")