Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
needs: lint
strategy:
matrix:
ckan-version: ["2.12", "2.11", "2.10"]
ckan-version: ["2.12", "2.11"]
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
Expand All @@ -38,7 +38,7 @@ jobs:
POSTGRES_DB: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:3
image: redis:7
env:
CKAN_SQLALCHEMY_URL: postgresql://ckan_default:pass@postgres/ckan_test
CKAN_DATASTORE_WRITE_URL: postgresql://datastore_write:pass@postgres/datastore_test
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CKAN Hierarchy extension Changelog

## Unreleased

New features:
- CKAN 2.12 support [#77](https://github.com/ckan/ckanext-hierarchy/pull/77)
- Drop support for CKAN 2.10 [#78](https://github.com/ckan/ckanext-hierarchy/pull/78)

Bug fixes:
- Pass the storage type to `h.uploads_enabled` on CKAN 2.12 [#78](https://github.com/ckan/ckanext-hierarchy/pull/78)

## 1.2.2

New features:
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,15 @@ TODO:

## Requirements

This extension requires CKAN v2.7 or later.
Currently tested only with CKAN 2.10 and 2.11.
Currently tested only with CKAN 2.11 and 2.12.

Compatibility with core CKAN versions:

| CKAN version | Compatible? |
| --------------- | ------------- |
| 2.9 and earlier | unmaintained |
| 2.10 | Yes |
| 2.11 | Yes |
| CKAN version | Compatible? |
| ---------------- | ------------ |
| 2.10 and earlier | unmaintained |
| 2.11 | Yes |
| 2.12 | Yes |


Pypi version unmaintained: https://pypi.org/project/ckanext-hierarchy/
Expand Down
12 changes: 2 additions & 10 deletions ckanext/hierarchy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ def get_allowable_parent_groups(group_id):

def is_include_children_selected():
include_children_selected = False

if p.toolkit.check_ckan_version(min_version="2.10"):
is_flask = True
else:
from ckan.common import is_flask_request
is_flask = is_flask_request()

if is_flask:
if request.args.get('include_children'):
include_children_selected = True
if request.args.get('include_children'):
include_children_selected = True
return include_children_selected
5 changes: 1 addition & 4 deletions ckanext/hierarchy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ def before_dataset_search(self, search_params):
# it's non-organization controller or CLI call
return search_params

if tk.check_ckan_version("2.10"):
controller = tk.get_endpoint()[0]
else:
controller = g.controller
controller = tk.get_endpoint()[0]

# e.g. search_params['q'] = u' owner_org:"id" include_children: "True"'
query = search_params.get('q', '')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
{% set is_upload = data.image_url and not data.image_url.startswith('http') %}
{% set is_url = data.image_url and data.image_url.startswith('http') %}

{{ form.image_upload(data, errors, is_upload_enabled=h.uploads_enabled(), is_url=is_url, is_upload=is_upload) }}
{# CKAN 2.12 expects the storage type, older versions take no argument #}
{% set is_upload_enabled = h.uploads_enabled('group') if h.check_ckan_version('2.12') else h.uploads_enabled() %}
{{ form.image_upload(data, errors, is_upload_enabled=is_upload_enabled, is_url=is_url, is_upload=is_upload) }}

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# http://packaging.python.org/en/latest/tutorial.html#version
version='1.2.2',
version='1.2.3',

description='''CKAN Organization hierarchy - templates and configuration''',
long_description=long_description,
Expand Down
Loading