From 745ce713b04fa7d876a10407cf647bf9196599fd Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Mon, 27 Jan 2020 16:29:25 -0500 Subject: [PATCH] Hard code TO upload description into the UploadInput Macro This is a temporary fix to avoid spending too much time trying to use app.config variables in a Form class field descriptions and labels. This is tech debt and should be fixed in the future. --- atst/forms/task_order.py | 13 +------------ templates/components/upload_input.html | 6 +++++- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/atst/forms/task_order.py b/atst/forms/task_order.py index ecc9fe97..1bd12f5a 100644 --- a/atst/forms/task_order.py +++ b/atst/forms/task_order.py @@ -26,7 +26,6 @@ from atst.utils.localization import translate from flask import current_app as app MAX_CLIN_AMOUNT = 1_000_000_000 -FILE_SIZE_LIMIT = 25 def coerce_enum(enum_inst): @@ -163,17 +162,7 @@ class TaskOrderForm(BaseForm): filters=[remove_empty_string, remove_dashes, coerce_upper], validators=[AlphaNumeric(), Length(min=13, max=17), Optional()], ) - pdf = FormField( - AttachmentForm, - label=translate( - "task_orders.form.supporting_docs_size_limit", - {"file_size_limit": FILE_SIZE_LIMIT}, - ), - description=translate( - "task_orders.form.supporting_docs_size_limit", - {"file_size_limit": FILE_SIZE_LIMIT}, - ), - ) + pdf = FormField(AttachmentForm) clins = FieldList(FormField(CLINForm)) diff --git a/templates/components/upload_input.html b/templates/components/upload_input.html index 882fcaef..4f4f307f 100644 --- a/templates/components/upload_input.html +++ b/templates/components/upload_input.html @@ -24,7 +24,11 @@ {{ field.label }} {% endif %}

- {{ field.description }} + + + {% set size_limit = file_size_limit // 1000000 %} + {{ "task_orders.form.supporting_docs_size_limit" | translate({ "file_size_limit": size_limit }) }}