From 4f2984deea6045fd577122aa65524cda694382f3 Mon Sep 17 00:00:00 2001 From: Vivek Santayana Date: Thu, 2 Feb 2023 22:38:49 +0000 Subject: [PATCH] Bugfix: exception for incomplete entry dates --- .../app/admin/templates/admin/components/certificate.html | 4 ++-- ref-test/app/admin/templates/admin/index.html | 6 +++--- ref-test/app/admin/templates/admin/result-detail.html | 2 +- ref-test/app/admin/templates/admin/test.html | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ref-test/app/admin/templates/admin/components/certificate.html b/ref-test/app/admin/templates/admin/components/certificate.html index 1263357..6800e7c 100644 --- a/ref-test/app/admin/templates/admin/components/certificate.html +++ b/ref-test/app/admin/templates/admin/components/certificate.html @@ -50,7 +50,7 @@
Start Time
- {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') }} + {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') if entry.start_time else None }}
  • @@ -59,7 +59,7 @@ Late {% endif %}
    - {{ entry.end_time.strftime('%d %b %Y %H:%M:%S') }} + {{ entry.end_time.strftime('%d %b %Y %H:%M:%S') if entry.end_time else None }}
  • diff --git a/ref-test/app/admin/templates/admin/index.html b/ref-test/app/admin/templates/admin/index.html index ca644f8..4b355ec 100644 --- a/ref-test/app/admin/templates/admin/index.html +++ b/ref-test/app/admin/templates/admin/index.html @@ -28,7 +28,7 @@ {{ test.get_code() }} - {{ test.end_date.strftime('%d %b %Y') }} + {{ test.end_date.strftime('%d %b %Y') if test.end_date else None }} {% endfor %} @@ -72,7 +72,7 @@ {{ result.get_surname() }}, {{ result.get_first_name() }} - {{ result.end_time.strftime('%d %b %Y %H:%M') }} + {{ result.end_time.strftime('%d %b %Y %H:%M') if result.end_time else None }} {{ (100*result.result['score']/result.result['max'])|round|int }}% ({{ result.result.grade }}) @@ -117,7 +117,7 @@ {{ test.get_code() }} - {{ test.end_date.strftime('%d %b %Y') }} + {{ test.end_date.strftime('%d %b %Y') if test.end_date else None }} {% endfor %} diff --git a/ref-test/app/admin/templates/admin/result-detail.html b/ref-test/app/admin/templates/admin/result-detail.html index 6a8bd6b..daffa8e 100644 --- a/ref-test/app/admin/templates/admin/result-detail.html +++ b/ref-test/app/admin/templates/admin/result-detail.html @@ -49,7 +49,7 @@
    Start Time
    - {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') }} + {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') if entry.start_time else None }}
  • {% endif %}
  • diff --git a/ref-test/app/admin/templates/admin/test.html b/ref-test/app/admin/templates/admin/test.html index a4cf407..6be88e2 100644 --- a/ref-test/app/admin/templates/admin/test.html +++ b/ref-test/app/admin/templates/admin/test.html @@ -32,13 +32,13 @@
    Start Date
    - {{ test.start_date.strftime('%d %b %Y %H:%M') }} + {{ test.start_date.strftime('%d %b %Y %H:%M') if test.start_date else None }}
  • Expiry Date
    - {{ test.end_date.strftime('%d %b %Y %H:%M') }} + {{ test.end_date.strftime('%d %b %Y %H:%M') if test.end_date else None }}