From 1750c268f7ab78ba0a720f995c4a44fab6d84802 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Mon, 1 Oct 2018 13:32:01 -0400 Subject: [PATCH 1/2] Fix report display for task order with no expiration date --- atst/routes/workspaces.py | 2 +- templates/workspaces/reports/index.html | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/atst/routes/workspaces.py b/atst/routes/workspaces.py index 708ed89b..31f35f38 100644 --- a/atst/routes/workspaces.py +++ b/atst/routes/workspaces.py @@ -121,7 +121,7 @@ def workspace_reports(workspace_id): remaining_difference = expiration_date - today remaining_days = remaining_difference.days else: - remaining_days = 0 + remaining_days = None return render_template( "workspaces/reports/index.html", diff --git a/templates/workspaces/reports/index.html b/templates/workspaces/reports/index.html index b87f6bf3..9a69dfcc 100644 --- a/templates/workspaces/reports/index.html +++ b/templates/workspaces/reports/index.html @@ -65,16 +65,26 @@
Expires
- - + {% if expiration_date %} + + + {% else %} + - + {% endif %}
Remaining
-
{{ remaining_days }} days
+
+ {% if remaining_days %} + {{ remaining_days }} days + {% else %} + - + {% endif %} +
From fc754250dd6bd9c1e2e0f481fdd07fc7d7d39873 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Mon, 1 Oct 2018 16:17:38 -0400 Subject: [PATCH 2/2] Check that remaining_days is not None --- templates/workspaces/reports/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/workspaces/reports/index.html b/templates/workspaces/reports/index.html index 9a69dfcc..2a75ee8f 100644 --- a/templates/workspaces/reports/index.html +++ b/templates/workspaces/reports/index.html @@ -79,7 +79,7 @@
Remaining
- {% if remaining_days %} + {% if remaining_days is not none %} {{ remaining_days }} days {% else %} -