Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/views/origin.py
Show First 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | try: | ||||
}) | }) | ||||
results = json.dumps(results) | results = json.dumps(results) | ||||
except Exception as exc: | except Exception as exc: | ||||
return handle_view_exception(request, exc, html_response=False) | return handle_view_exception(request, exc, html_response=False) | ||||
return HttpResponse(results, content_type='application/json') | return HttpResponse(results, content_type='application/json') | ||||
@browse_route(r'origin/(?P<origin_id>[0-9]+)/latest_snapshot/', | @browse_route(r'origin/(?P<origin_id>[0-9a-f]+)/latest_snapshot/', | ||||
view_name='browse-origin-latest-snapshot') | view_name='browse-origin-latest-snapshot') | ||||
def _origin_latest_snapshot(request, origin_id): | def _origin_latest_snapshot(request, origin_id): | ||||
""" | """ | ||||
Internal browse endpoint used to check if an origin has already | Internal browse endpoint used to check if an origin has already | ||||
been visited by Software Heritage and has at least one full visit. | been visited by Software Heritage and has at least one full visit. | ||||
""" | """ | ||||
result = \ | result = \ | ||||
service.lookup_latest_origin_snapshot(origin_id, | service.lookup_latest_origin_snapshot(origin_id, | ||||
Show All 20 Lines |