diff --git a/webapp/apps/constants.py b/webapp/apps/constants.py index d93f9eb2..6e76f9af 100644 --- a/webapp/apps/constants.py +++ b/webapp/apps/constants.py @@ -1,5 +1,7 @@ import os +from django.utils.safestring import mark_safe + DISTRIBUTION_TOOLTIP = "Key variables in the computation of tax liabilities." DIFFERENCE_TOOLTIP = "Key variables that highlight the differences between two tax plans." PAYROLL_TOOLTIP = " Include employee and employer payroll taxes in output." @@ -22,3 +24,16 @@ DEFAULT_SOURCE = os.environ.get('DEFAULT_SOURCE', 'PUF') TAXCALC_VERS_RESULTS_BACKWARDS_INCOMPATIBLE = "0.13.0" + +OUT_OF_RANGE_ERROR_MSG = mark_safe(""" +
+ Some fields have warnings or errors. Fields with warnings have message(s) + below them beginning with \'WARNING\', and fields with errors have + message(s) below them beginning with \'ERROR\'. +

+  - If the field has a warning message , then review the input to make sure + it is correct and click \'SUBMIT\' to run the model with these inputs. +
+  - If the field has an error message, then the parameter value must be + changed so that it is in a valid range. +
""") diff --git a/webapp/apps/taxbrain/views.py b/webapp/apps/taxbrain/views.py index cadda1ff..fb3c6557 100644 --- a/webapp/apps/taxbrain/views.py +++ b/webapp/apps/taxbrain/views.py @@ -54,7 +54,7 @@ REFORM_TOOLTIP, FISCAL_CURRENT_LAW, FISCAL_REFORM, FISCAL_CHANGE, INCOME_BINS_TOOLTIP, INCOME_DECILES_TOOLTIP, START_YEAR, START_YEARS, - DATA_SOURCES, DEFAULT_SOURCE) + DATA_SOURCES, DEFAULT_SOURCE, OUT_OF_RANGE_ERROR_MSG) from ..formatters import get_version from .param_formatters import (get_reform_from_file, get_reform_from_gui, @@ -70,11 +70,6 @@ JOB_PROC_TIME_IN_SECONDS = 100 -OUT_OF_RANGE_ERROR_MSG = ("Some fields have warnings or errors. Values " - "outside of suggested ranges will be accepted if " - "they only cause warnings and are submitted again " - "from this page. Warning messages begin with " - "'WARNING', and error messages begin with 'ERROR'.") def log_ip(request): """ @@ -296,8 +291,7 @@ def submit_reform(request, user=None, json_reform_id=None): "Please specify a tax-law change before submitting." ) if taxcalc_warnings or taxcalc_errors: - msg = OUT_OF_RANGE_ERROR_MSG - personal_inputs.add_error(None, msg) + personal_inputs.add_error(None, OUT_OF_RANGE_ERROR_MSG) if has_parse_errors: msg = ("Some fields have unrecognized values. Enter comma " "separated values for each input.")