From 7c5cbd4291bed3fb12c23cf4c25abd4e0556d2b2 Mon Sep 17 00:00:00 2001
From: Reid 'arrdem' McKenzie <me@arrdem.com>
Date: Thu, 22 Jun 2023 15:01:04 -0600
Subject: [PATCH 1/2] Fix: Only if it would be non-null

---
 .../src/python/tentacles/templates/jobs_history.html.j2         | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/projects/tentacles/src/python/tentacles/templates/jobs_history.html.j2 b/projects/tentacles/src/python/tentacles/templates/jobs_history.html.j2
index 30060fe..cadc3c4 100644
--- a/projects/tentacles/src/python/tentacles/templates/jobs_history.html.j2
+++ b/projects/tentacles/src/python/tentacles/templates/jobs_history.html.j2
@@ -20,10 +20,12 @@
       <label for="filename">File</label>
       <span name="filename">{{ctx.db.fetch_file(ctx.uid, job.file_id).filename or "it's a secret"}}</span>
     </div>
+    {% if job.finished_at and job.started_at %}
     <div class="job-runtime u-flex">
       <label for="runtime">Runtime</label>
       <span name="Runtime">{{ (datetime.fromisoformat(job.finished_at) - datetime.fromisoformat(job.started_at)) }}</span>
     </div>
+    {% endif %}
     </div>
   <div class="controls u-flex u-ml-auto">
     {% if ctx.uid %}

From eb7f85d966ef7da11f41426b336ddc5702cec04f Mon Sep 17 00:00:00 2001
From: Reid 'arrdem' McKenzie <me@arrdem.com>
Date: Thu, 22 Jun 2023 15:01:21 -0600
Subject: [PATCH 2/2] Fix: if the login attempt failed, return None

---
 projects/tentacles/src/python/tentacles/db.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/projects/tentacles/src/python/tentacles/db.py b/projects/tentacles/src/python/tentacles/db.py
index 6126c51..30f4547 100644
--- a/projects/tentacles/src/python/tentacles/db.py
+++ b/projects/tentacles/src/python/tentacles/db.py
@@ -173,8 +173,7 @@ class Db(Queries):
         digest.update(password.encode("utf-8"))
         res = super().try_login(username=username, hash=digest.hexdigest())
         if not res:
-            res = self.fetch_user_status(sid=res.status_id)
-            raise LoginError(res.name)
+            return None
 
         return self.create_key(uid=res.id, name="web session", ttl=ttl)