Commit 934cd2e9 authored by Bruno Duyé's avatar Bruno Duyé

fix: crash when trying to get created_at for a non-commited dataset

parent da53a763
Pipeline #95276 passed with stage
in 18 seconds
......@@ -132,8 +132,9 @@ def build_dataset_solr(solr, provider_json, dataset_json, indexed_at, repo):
log.info("Could not read Git first commit date in %r (command: %r).", repo.path, git_log_reverse_cmd)
else:
commit_timestamp_str = output.strip()
commit_datetime = datetime.utcfromtimestamp(int(commit_timestamp_str))
dataset_solr["created_at"] = commit_datetime.isoformat() + 'Z'
if commit_timestamp_str:
commit_datetime = datetime.utcfromtimestamp(int(commit_timestamp_str))
dataset_solr["created_at"] = commit_datetime.isoformat() + 'Z'
return dataset_solr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment