From 122b9bd781a4720cbfb98679cadfa85f69c29225 Mon Sep 17 00:00:00 2001 From: Brian McLaughlin Date: Mon, 28 Aug 2023 11:39:17 -0400 Subject: [PATCH] Add check for ANSIBLE_COLLECT_DOWNLOAD_COUNT setting (#1849) * Add check for ANSIBLE_COLLECT_DOWNLOAD_COUNT No-Issue * Default to false No-Issue --- galaxy_ng/app/api/v3/viewsets/collection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/galaxy_ng/app/api/v3/viewsets/collection.py b/galaxy_ng/app/api/v3/viewsets/collection.py index a02133ddd4..31efdaa79a 100644 --- a/galaxy_ng/app/api/v3/viewsets/collection.py +++ b/galaxy_ng/app/api/v3/viewsets/collection.py @@ -179,6 +179,9 @@ def get(self, request, *args, **kwargs): request, filename, distro_base_path ) + if settings.get("ANSIBLE_COLLECT_DOWNLOAD_COUNT", False): + pulp_ansible_views.CollectionArtifactDownloadView.count_download(filename) + if settings.GALAXY_DEPLOYMENT_MODE == DeploymentMode.INSIGHTS.value: url = 'http://{host}:{port}/{prefix}/{distro_base_path}/{filename}'.format( host=settings.X_PULP_CONTENT_HOST,