diff --git a/swh/web/common/service.py b/swh/web/common/service.py --- a/swh/web/common/service.py +++ b/swh/web/common/service.py @@ -850,9 +850,6 @@ """ visit = storage.origin_visit_get_latest( origin_url, require_snapshot=require_snapshot) - if isinstance(visit['origin'], int): - # soon-to-be-legacy origin ids - visit['origin'] = storage.origin_get({'id': visit['origin']})['url'] return converters.from_origin_visit(visit) diff --git a/swh/web/tests/api/views/test_origin.py b/swh/web/tests/api/views/test_origin.py --- a/swh/web/tests/api/views/test_origin.py +++ b/swh/web/tests/api/views/test_origin.py @@ -234,6 +234,17 @@ self, new_origin, visit_dates, new_snapshots): self.storage.origin_add_one(new_origin) + + url = reverse('api-1-origin-visit-latest', + url_args={'origin_url': new_origin['url']}) + + rv = self.client.get(url) + self.assertEqual(rv.status_code, 404, rv.data) + self.assertEqual(rv.data, { + 'exception': 'NotFoundExc', + 'reason': 'No visit for origin %s found' % new_origin['url'] + }) + visit_dates.sort() visit_ids = [] for i, visit_date in enumerate(visit_dates):