From 29f6354fbfcc20481d603c523be9f14695e12bd1 Mon Sep 17 00:00:00 2001 From: Jumana B Date: Wed, 4 Dec 2024 13:47:46 -0500 Subject: [PATCH] Change/annual limit (#2011) * Set annual limits to read from the DB * formatting --- app/templates/views/service-settings.html | 17 ++--------------- gunicorn_config.py | 1 + 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index 84c63a5226..0725630dea 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -192,12 +192,7 @@

{{ _('Your service is in trial mode') }}

{% call settings_row(if_has_permission='email') %} {% set txt = _('Annual maximum
(April 1 to March 31)') %} {{ text_field(txt) }} - {# TODO: FF_ANNUAL_LIMIT removal #} - {% if config["FF_ANNUAL_LIMIT"] %} - {% set annual_limit = _('{} emails').format((current_service.email_annual_limit) | format_number) %} - {% else %} - {% set annual_limit = _('{} million emails').format((limits.free_yearly_email//1000000) | format_number) %} - {% endif%} + {% set annual_limit = _('{} emails').format((current_service.email_annual_limit) | format_number) %} {{ text_field(annual_limit, attributes="data-testid=email-annual-limit") }} {{ text_field('')}} {% endcall %} @@ -271,12 +266,7 @@

{{ _('Your service is in trial mode') }}

{% call settings_row(if_has_permission='sms') %} {% set txt = _('Annual maximum
(April 1 to March 31)') %} {{ text_field(txt) }} - {# TODO: FF_ANNUAL_LIMIT removal #} - {% if config["FF_ANNUAL_LIMIT"] %} - {% set annual_sms_limit = _('{} text messages').format((current_service.sms_annual_limit) | format_number) %} - {% else %} - {% set annual_sms_limit = _('{} text messages').format((limits.free_yearly_sms) | format_number) %} - {% endif%} + {% set annual_sms_limit = _('{} text messages').format((current_service.sms_annual_limit) | format_number) %} {{ text_field(annual_sms_limit, attributes="data-testid=sms-annual-limit") }} {{ text_field('')}} {% endcall %} @@ -383,8 +373,6 @@

{{ _('Platform admin settings') }}

) }} {% endcall %} - {# TODO: FF_ANNUAL_LIMIT removal #} - {% if config["FF_ANNUAL_LIMIT"] %} {% call row() %} {% set txt = _('Annual email limit') %} {{ text_field(txt)}} @@ -408,7 +396,6 @@

{{ _('Platform admin settings') }}

for=txt ) }} {% endcall %} - {% endif %} {% call row() %} {% set txt = _('API rate limit per minute') %} diff --git a/gunicorn_config.py b/gunicorn_config.py index 63325ca386..cf6e5e7112 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -51,6 +51,7 @@ # Start timer for total running time start_time = time.time() + def on_starting(server): server.log.info("Starting Notifications Admin")