diff --git a/swh/web/common/origin_visits.py b/swh/web/common/origin_visits.py index 4adaed89..e37eedaa 100644 --- a/swh/web/common/origin_visits.py +++ b/swh/web/common/origin_visits.py @@ -125,9 +125,9 @@ def get_origin_visit( return visits[0] if not visit_ts: - # returns the latest full visit when no timestamp is provided + # returns the latest visit with a valid snapshot when no timestamp is provided for v in reversed(visits): - if v["status"] == "full": + if v["snapshot"] is not None: return v return visits[-1]