Handle incomplete query

This commit is contained in:
Edward Betts 2019-11-26 18:41:35 +00:00
parent d94d1bb170
commit d12c85cfde
2 changed files with 8 additions and 3 deletions

View file

@ -111,9 +111,10 @@ class WikidataQuery(Base):
error_text = Column(String) error_text = Column(String)
query_template = Column(String) query_template = Column(String)
@hybrid_property @property
def duration(self): def duration(self):
return self.end_time - self.start_time if self.end_time:
return self.end_time - self.start_time
@property @property
def display_seconds(self): def display_seconds(self):

View file

@ -25,7 +25,11 @@
{% if obj.status_code != 200 %}{% set class=" text-light bg-danger"%}{% endif %} {% if obj.status_code != 200 %}{% set class=" text-light bg-danger"%}{% endif %}
<div class="row"> <div class="row">
<div class="col-2{{ class }}"> <div class="col-2{{ class }}">
{{ obj.start_time.strftime('%Y %b %d %H:%M') }} {% if obj.end_time %}
{{ obj.start_time.strftime('%Y %b %d %H:%M') }}
{% else %}
running
{% endif %}
</div> </div>
<div class="col-4"><a href="{{ obj.path }}">{{ obj.path }}</a></div> <div class="col-4"><a href="{{ obj.path }}">{{ obj.path }}</a></div>