From a60e3b414ea7df22eb3bab8663a3264aaef4e86d Mon Sep 17 00:00:00 2001 From: Brian Scholer <1260690+briantist@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:08:40 -0400 Subject: [PATCH] fix another 500 error on no local collection (#116) * fix another 500 error on no local collection * update changelog --- changelogs/fragments/114-bugfixes.yml | 2 +- galactory/api/v2/collections.py | 2 +- galactory/api/v3/collections.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelogs/fragments/114-bugfixes.yml b/changelogs/fragments/114-bugfixes.yml index 07b31d8..6d15f7d 100644 --- a/changelogs/fragments/114-bugfixes.yml +++ b/changelogs/fragments/114-bugfixes.yml @@ -1,4 +1,4 @@ --- bugfixes: - - Requests for collections that were not already present in artifactory resulted in a 500 internal server error (https://github.com/briantist/galactory/issues/112). + - Requests for collections that were not already present in artifactory resulted in a 500 internal server error (https://github.com/briantist/galactory/issues/112, https://github.com/briantist/galactory/pull/116). - Requests proxied to a v2 upstream endpoint that supports pagination caused a 400 error from the upstream due to the inclusion of the v3 ``limit`` query string parameter (https://github.com/briantist/galactory/issues/113). diff --git a/galactory/api/v2/collections.py b/galactory/api/v2/collections.py index 2111c31..63e095e 100644 --- a/galactory/api/v2/collections.py +++ b/galactory/api/v2/collections.py @@ -105,7 +105,7 @@ def collection(namespace, collection): if upstream_result: if colgroup is None: - result = upstream_result + return upstream_result else: try: upstream_version = VersionInfo.parse(upstream_result['latest_version']['version']) diff --git a/galactory/api/v3/collections.py b/galactory/api/v3/collections.py index 83315ec..291968d 100644 --- a/galactory/api/v3/collections.py +++ b/galactory/api/v3/collections.py @@ -118,7 +118,7 @@ def collection(namespace, collection): if upstream_result: if colgroup is None: - result = upstream_result + return upstream_result else: try: upstream_version = VersionInfo.parse(upstream_result['highest_version']['version'])