Skip to content

Commit

Permalink
Change/annual limit (#2011)
Browse files Browse the repository at this point in the history
* Set annual limits to read from the DB

* formatting
  • Loading branch information
jzbahrai authored Dec 4, 2024
1 parent 992103f commit 29f6354
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
17 changes: 2 additions & 15 deletions app/templates/views/service-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,7 @@ <h2 class="heading-small p-0 m-0">{{ _('Your service is in trial mode') }}</h2>
{% call settings_row(if_has_permission='email') %}
{% set txt = _('Annual maximum</br>(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 %}
Expand Down Expand Up @@ -271,12 +266,7 @@ <h2 class="heading-small p-0 m-0">{{ _('Your service is in trial mode') }}</h2>
{% call settings_row(if_has_permission='sms') %}
{% set txt = _('Annual maximum</br>(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 %}
Expand Down Expand Up @@ -383,8 +373,6 @@ <h2 class="heading-medium">{{ _('Platform admin settings') }}</h2>
) }}
{% endcall %}

{# TODO: FF_ANNUAL_LIMIT removal #}
{% if config["FF_ANNUAL_LIMIT"] %}
{% call row() %}
{% set txt = _('Annual email limit') %}
{{ text_field(txt)}}
Expand All @@ -408,7 +396,6 @@ <h2 class="heading-medium">{{ _('Platform admin settings') }}</h2>
for=txt
) }}
{% endcall %}
{% endif %}

{% call row() %}
{% set txt = _('API rate limit per minute') %}
Expand Down
1 change: 1 addition & 0 deletions gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
# Start timer for total running time
start_time = time.time()


def on_starting(server):
server.log.info("Starting Notifications Admin")

Expand Down

0 comments on commit 29f6354

Please sign in to comment.