diff --git a/swh/web/common/archive.py b/swh/web/common/archive.py --- a/swh/web/common/archive.py +++ b/swh/web/common/archive.py @@ -218,7 +218,7 @@ if not lic: return None - return converters.from_swh({"id": sha1, "facts": lic[sha1]}, hashess={"id"}) + return converters.from_swh(lic.to_dict(), hashess={"id"}) def lookup_origin(origin: OriginInfo) -> OriginInfo: diff --git a/swh/web/tests/conftest.py b/swh/web/tests/conftest.py --- a/swh/web/tests/conftest.py +++ b/swh/web/tests/conftest.py @@ -340,10 +340,9 @@ def content_get_license(self, cnt_id): cnt_id_bytes = hash_to_bytes(cnt_id) - lic = next(self.idx_storage.content_fossology_license_get([cnt_id_bytes])) - return converters.from_swh( - {"id": cnt_id_bytes, "facts": lic[cnt_id_bytes]}, hashess={"id"} - ) + licenses = self.idx_storage.content_fossology_license_get([cnt_id_bytes]) + for license in licenses: + return converters.from_swh(license.to_dict(), hashess={"id"}) def content_add_ctags(self, cnt_id): self.ctags_indexer.run([hash_to_bytes(cnt_id)], "update-dups")