windows can't handle 0 timestamps

This commit is contained in:
Christoph Reiter
2017-09-18 11:35:08 +02:00
parent 9b323f69cb
commit 8fb2bc0ac0

View File

@@ -309,8 +309,11 @@ def parse_repo(repo, repo_variant, url):
@app.template_filter('timestamp')
def _jinja2_filter_timestamp(d):
return datetime.datetime.fromtimestamp(
int(d)).strftime('%Y-%m-%d %H:%M:%S')
try:
return datetime.datetime.fromtimestamp(
int(d)).strftime('%Y-%m-%d %H:%M:%S')
except OSError:
return "-"
@app.template_filter('filesize')