From 1750c268f7ab78ba0a720f995c4a44fab6d84802 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Mon, 1 Oct 2018 13:32:01 -0400 Subject: [PATCH] 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 %} +