request stats for today from send page from GET /service/:id endpoint

also amended test cases to ensure they mock out correct call
This commit is contained in:
Leo Hemsted
2016-07-25 14:16:34 +01:00
parent 40ed6dfe8e
commit 0accd88869
6 changed files with 52 additions and 79 deletions

View File

@@ -11,10 +11,8 @@
.
</p>
<p>
{% if statistics.emails_requested or statistics.sms_requested %}
You can still send
{{ current_service.message_limit - statistics.get('emails_requested', 0) - statistics.get('sms_requested', 0) }}
messages today, but
{% if current_service.message_limit != remaining_messages %}
You can still send {{ remaining_messages }} messages today, but
{% endif %}
{{ original_file_name }} contains
{{ count_of_recipients }} {{ recipients.recipient_column_header }}

View File

@@ -103,7 +103,7 @@
{% endcall %}
</div>
{% elif count_of_recipients > (current_service.message_limit - statistics.get('emails_requested', 0) - statistics.get('sms_requested', 0)) %}
{% elif recipients.more_rows_than_can_send %}
{% include "partials/check/too-many-messages.html" %}
{% else %}
@@ -134,10 +134,7 @@
</div>
{% endif %}
{% if (
errors or
count_of_recipients > (current_service.message_limit - statistics.get('emails_requested', 0) - statistics.get('sms_requested', 0))
) %}
{% if errors %}
{% if request.args.from_test %}
<a href="{{ back_link }}" class="page-footer-back-link">Back</a>
{% else %}