Skip to content

Commit

Permalink
Merge pull request #487 from ckan/futureproof_version_check
Browse files Browse the repository at this point in the history
Futureproof version check to work also on 3.0+
  • Loading branch information
amercader authored Jan 24, 2022
2 parents b702bf9 + e650be8 commit ddc891f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ckanext/harvest/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block styles %}
{{ super() }}

{% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %}
{% set type = 'asset' if h.ckan_version().split('.')|map('int')|list >= [2, 9, 0] else 'resource' %}
{% include 'harvest/snippets/harvest_' ~ type ~ '.html' %}

{% endblock %}
2 changes: 1 addition & 1 deletion ckanext/harvest/templates/source/new_source_form.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% import 'macros/form.html' as form %}


{% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %}
{% set type = 'asset' if h.ckan_version().split('.')|map('int')|list >= [2, 9, 0] else 'resource' %}
{% include 'harvest/snippets/harvest_extra_field_' ~ type ~ '.html' %}

<form id="source-new" class="form-horizontal dataset-form {{ h.bootstrap_version() }}" method="post" >
Expand Down

0 comments on commit ddc891f

Please sign in to comment.