From 41d7508dabec94ddd338d68d140b7555d679c5df Mon Sep 17 00:00:00 2001 From: agmorev Date: Tue, 2 Apr 2024 00:28:28 +0300 Subject: [PATCH 1/2] Fix ckan version comparison --- ckanext/scheming/templates/scheming/form_snippets/slug.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/scheming/templates/scheming/form_snippets/slug.html b/ckanext/scheming/templates/scheming/form_snippets/slug.html index 2428e10c..0afa5805 100644 --- a/ckanext/scheming/templates/scheming/form_snippets/slug.html +++ b/ckanext/scheming/templates/scheming/form_snippets/slug.html @@ -1,6 +1,6 @@ {% import 'macros/form.html' as form %} -{% set read_endpoint = '.read' if h.ckan_version() > '2.9' else '_read' %} +{% set read_endpoint = '.read' if h.ckan_version().split('.')[1] | int >= 9 else '_read' %} {%- if entity_type == 'dataset' %} {%- set controller = 'package' -%} From fe08270a5ae416fc34ce7921f8241eb35a276a93 Mon Sep 17 00:00:00 2001 From: agmorev Date: Wed, 3 Apr 2024 11:08:10 +0300 Subject: [PATCH 2/2] Use check_ckan_version --- ckanext/scheming/templates/scheming/form_snippets/slug.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/scheming/templates/scheming/form_snippets/slug.html b/ckanext/scheming/templates/scheming/form_snippets/slug.html index 0afa5805..9ce55c42 100644 --- a/ckanext/scheming/templates/scheming/form_snippets/slug.html +++ b/ckanext/scheming/templates/scheming/form_snippets/slug.html @@ -1,6 +1,6 @@ {% import 'macros/form.html' as form %} -{% set read_endpoint = '.read' if h.ckan_version().split('.')[1] | int >= 9 else '_read' %} +{% set read_endpoint = '.read' if h.check_ckan_version(min_version="2.9") else '_read' %} {%- if entity_type == 'dataset' %} {%- set controller = 'package' -%}