diff --git a/depicts/model.py b/depicts/model.py index 3e18169..7f08e26 100644 --- a/depicts/model.py +++ b/depicts/model.py @@ -111,9 +111,10 @@ class WikidataQuery(Base): error_text = Column(String) query_template = Column(String) - @hybrid_property + @property def duration(self): - return self.end_time - self.start_time + if self.end_time: + return self.end_time - self.start_time @property def display_seconds(self): diff --git a/templates/query_list.html b/templates/query_list.html index ad173d9..3049df1 100644 --- a/templates/query_list.html +++ b/templates/query_list.html @@ -25,7 +25,11 @@ {% if obj.status_code != 200 %}{% set class=" text-light bg-danger"%}{% endif %}