From 19a94cdba475eec1f4ad54642515e279435d7211 Mon Sep 17 00:00:00 2001 From: Patrick Huck Date: Thu, 15 Feb 2024 11:23:31 -0800 Subject: [PATCH] ensure max projects is int --- mpcontribs-api/mpcontribs/api/projects/views.py | 2 +- mpcontribs-api/supervisord/conf.py | 2 +- mpcontribs-api/supervisord/supervisord.conf.jinja | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mpcontribs-api/mpcontribs/api/projects/views.py b/mpcontribs-api/mpcontribs/api/projects/views.py index d483f5486..8560e563d 100644 --- a/mpcontribs-api/mpcontribs/api/projects/views.py +++ b/mpcontribs-api/mpcontribs/api/projects/views.py @@ -15,7 +15,7 @@ templates = os.path.join(os.path.dirname(flask_mongorest.__file__), "templates") projects = Blueprint("projects", __name__, template_folder=templates) -MAX_PROJECTS = os.environ.get("MAX_PROJECTS", 3) +MAX_PROJECTS = int(os.environ.get("MAX_PROJECTS", 3)) class ColumnResource(Resource): diff --git a/mpcontribs-api/supervisord/conf.py b/mpcontribs-api/supervisord/conf.py index cc7dbad57..fb0dde081 100644 --- a/mpcontribs-api/supervisord/conf.py +++ b/mpcontribs-api/supervisord/conf.py @@ -18,7 +18,7 @@ "db": db, "s3": s3, "tm": tm.upper(), - "max_projects": max_projects if max_projects else 3 + "max_projects": int(max_projects) if max_projects else 3 } kwargs = { diff --git a/mpcontribs-api/supervisord/supervisord.conf.jinja b/mpcontribs-api/supervisord/supervisord.conf.jinja index 953cc774b..62811a5c7 100644 --- a/mpcontribs-api/supervisord/supervisord.conf.jinja +++ b/mpcontribs-api/supervisord/supervisord.conf.jinja @@ -78,7 +78,7 @@ environment= MPCONTRIBS_API_HOST="{{ mpcontribs_api_host }}:{{ cfg.api_port }}", MPCONTRIBS_DB_NAME="mpcontribs-{{ cfg.db }}", TRADEMARK="{{ cfg.tm }}", - MAX_PROJECTS="{{ cfg.max_projects }}", + MAX_PROJECTS={{ cfg.max_projects }}, S3_DOWNLOADS_BUCKET="mpcontribs-downloads-{{ cfg.s3 }}", S3_ATTACHMENTS_BUCKET="mpcontribs-attachments-{{ cfg.s3 }}", S3_IMAGES_BUCKET="mpcontribs-images-{{ cfg.s3 }}",