From 55e694883e5d119bc9f88751d227f8aedd75013e Mon Sep 17 00:00:00 2001 From: Kristoffer Rath Hansen Date: Mon, 7 Oct 2024 20:59:15 +0200 Subject: [PATCH 1/3] Introduce setting to increase max number fields --- forenings_medlemmer/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/forenings_medlemmer/settings.py b/forenings_medlemmer/settings.py index fc9d7685..411702dd 100644 --- a/forenings_medlemmer/settings.py +++ b/forenings_medlemmer/settings.py @@ -99,6 +99,8 @@ CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5" CRISPY_TEMPLATE_PACK = "bootstrap5" +DATA_UPLOAD_MAX_NUMBER_FIELDS = os.environ["DATA_UPLOAD_MAX_NUMBER_FIELDS"] + MIDDLEWARE = ( "django.middleware.security.SecurityMiddleware", "corsheaders.middleware.CorsMiddleware", From 6d8ff2323cf1d867f1849a07fd5581ad69004afc Mon Sep 17 00:00:00 2001 From: Kristoffer Rath Hansen Date: Mon, 7 Oct 2024 21:03:52 +0200 Subject: [PATCH 2/3] Include DATA_UPLOAD_MAX_NUMBER_FIELDS in .env.example --- .env.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.env.example b/.env.example index 4a9f11a4..f80f5534 100644 --- a/.env.example +++ b/.env.example @@ -60,3 +60,5 @@ DATABASE_URL=postgres://postgres_user:postgres_password@database/database_name POSTGRES_USER=postgres_user POSTGRES_PASSWORD=postgres_password POSTGRES_DB=database_name + +DATA_UPLOAD_MAX_NUMBER_FIELDS = 10240 From 03f006b62d7eb59b36eb1857ba58671166de118d Mon Sep 17 00:00:00 2001 From: Kristoffer Rath Hansen Date: Mon, 7 Oct 2024 21:17:24 +0200 Subject: [PATCH 3/3] Import as int --- forenings_medlemmer/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forenings_medlemmer/settings.py b/forenings_medlemmer/settings.py index 411702dd..f2a3eafa 100644 --- a/forenings_medlemmer/settings.py +++ b/forenings_medlemmer/settings.py @@ -99,7 +99,7 @@ CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5" CRISPY_TEMPLATE_PACK = "bootstrap5" -DATA_UPLOAD_MAX_NUMBER_FIELDS = os.environ["DATA_UPLOAD_MAX_NUMBER_FIELDS"] +DATA_UPLOAD_MAX_NUMBER_FIELDS = int(os.environ["DATA_UPLOAD_MAX_NUMBER_FIELDS"]) MIDDLEWARE = ( "django.middleware.security.SecurityMiddleware",