From b6b110765a2e7b2443776d305f126499c9ed3cfb Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Mon, 20 Jan 2025 14:05:15 -0800 Subject: [PATCH] flake8 and fixing conditionals --- app/main/views/dashboard.py | 2 +- app/templates/views/dashboard/activity-table.html | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py index 812586a95..1f8cac573 100644 --- a/app/main/views/dashboard.py +++ b/app/main/views/dashboard.py @@ -14,7 +14,7 @@ from app import ( service_api_client, template_statistics_client, ) -from app.formatters import format_date_numeric, format_datetime_numeric, get_time_left +from app.formatters import format_date_numeric, format_datetime_numeric from app.main import main from app.main.views.user_profile import set_timezone from app.statistics_utils import get_formatted_percentage diff --git a/app/templates/views/dashboard/activity-table.html b/app/templates/views/dashboard/activity-table.html index eec134ebf..5739002e9 100644 --- a/app/templates/views/dashboard/activity-table.html +++ b/app/templates/views/dashboard/activity-table.html @@ -27,16 +27,13 @@ {{ job.template_name }} {% if job.scheduled_for and not job.processing_finished %} - Scheduled for - {{ job.scheduled_for|format_datetime_table }} - {% else %} - {% if job.processing_finished %} - Sent on {{job.processing_finished|format_datetime_table}} + Scheduled for {{ job.scheduled_for|format_datetime_table }} + {% elif job.processing_finished and not job.statistics|selectattr('status', 'equalto', 'sending')|list %} + Sent on {{ job.processing_finished|format_datetime_table }} {% elif job.processing_started %} - Sending since {{job.processing_started|format_datetime_table}} + Sending since {{ job.processing_started|format_datetime_table }} {% else %} - Pending since {{job.created_at|format_datetime_table}} - {% endif %} + Pending since {{ job.created_at|format_datetime_table }} {% endif %} {{ job.created_by.name }}