Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P650
swh-web: Fix latest valid snapshot browsing
Active
Public
Actions
Authored by
anlambert
on Apr 21 2020, 11:44 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
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]
Event Timeline
anlambert
created this paste.
Apr 21 2020, 11:44 AM
2020-04-21 11:44:08 (UTC+2)
Log In to Comment