diff --git a/tests/unit/packaging/test_models.py b/tests/unit/packaging/test_models.py index f214af20062d..5eaf18a33a50 100644 --- a/tests/unit/packaging/test_models.py +++ b/tests/unit/packaging/test_models.py @@ -782,6 +782,11 @@ def test_is_url_verified(self, db_session, url, publisher_url, expected): tag="fake:event", additional={"publisher_url": publisher_url}, ) + DBFileEventFactory.create( + source=release_file, + tag="fake:event", + additional={"publisher_url": publisher_url}, + ) assert project.is_verified_url(url) is expected diff --git a/warehouse/packaging/models.py b/warehouse/packaging/models.py index 086cbe029ccd..69846f5b8064 100644 --- a/warehouse/packaging/models.py +++ b/warehouse/packaging/models.py @@ -414,7 +414,7 @@ def is_verified_url(self, url): File.Event.additional.op("->>")("publisher_url") + "%" ) ) - .scalar() + .first() ) is not None diff --git a/warehouse/templates/includes/packaging/project-data.html b/warehouse/templates/includes/packaging/project-data.html index 0e4d61bfef32..9a7bff4d498a 100644 --- a/warehouse/templates/includes/packaging/project-data.html +++ b/warehouse/templates/includes/packaging/project-data.html @@ -26,7 +26,7 @@