From ba0bffb54565aaf0052bcaf319eab764891a2561 Mon Sep 17 00:00:00 2001 From: Chas Nelson Date: Fri, 4 Aug 2023 12:42:57 +0100 Subject: [PATCH] wip delete me --- .../unaids/assets/autocomplete-without-creating-new-options.js | 3 ++- ckanext/unaids/assets/validation-badge.js | 2 ++ ckanext/unaids/helpers.py | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ckanext/unaids/assets/autocomplete-without-creating-new-options.js b/ckanext/unaids/assets/autocomplete-without-creating-new-options.js index d794184b..aac55a0f 100644 --- a/ckanext/unaids/assets/autocomplete-without-creating-new-options.js +++ b/ckanext/unaids/assets/autocomplete-without-creating-new-options.js @@ -35,6 +35,7 @@ this.ckan.module('autocomplete-without-creating-new-options', function (jQuery) * Returns nothing. */ initialize: function () { + console.log("test"); jQuery.proxyAll(this, /_on/, /format/); this.setupAutoComplete(); }, @@ -275,4 +276,4 @@ this.ckan.module('autocomplete-without-creating-new-options', function (jQuery) } } }; -}); \ No newline at end of file +}); diff --git a/ckanext/unaids/assets/validation-badge.js b/ckanext/unaids/assets/validation-badge.js index 685441e8..d7fc7c40 100644 --- a/ckanext/unaids/assets/validation-badge.js +++ b/ckanext/unaids/assets/validation-badge.js @@ -6,12 +6,14 @@ this.ckan.module('validation-badge', function (jQuery) { url: null }, initialize: function () { + console.log('validation-badge module initialized'); $.proxyAll(this, /_on/); this._poll(); this.options.url = $(this.el).attr('href'); $(this.el).removeAttr('href'); }, _poll: function() { + console.log("Polling...") var module = this; $.ajax({ url: "/api/3/action/resource_validation_show?resource_id=" + this.options.resource, diff --git a/ckanext/unaids/helpers.py b/ckanext/unaids/helpers.py index 1d6cd109..70dd8e85 100644 --- a/ckanext/unaids/helpers.py +++ b/ckanext/unaids/helpers.py @@ -226,6 +226,8 @@ def unaids_get_validation_badge(resource, in_listing=False): toolkit.config.get('ckanext.validation.show_badges_in_listings', True)): return '' + print("validation status is " + str(resource.get('validation_status'))) + if not resource.get('validation_status'): return ''