From a22210e9ab3ca647a95fb561f789ea678ee09a64 Mon Sep 17 00:00:00 2001 From: Marija <93824048+MarijaKnezevic@users.noreply.github.com> Date: Thu, 19 Jan 2023 12:02:34 +0100 Subject: [PATCH 01/44] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5efd989..769ef83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -Jinja2==2.11.3 +Jinja2==3.1.2 From 3d362355d72ab38f0743bcff2b1fa432ad2d3305 Mon Sep 17 00:00:00 2001 From: Marija <93824048+MarijaKnezevic@users.noreply.github.com> Date: Thu, 19 Jan 2023 12:07:24 +0100 Subject: [PATCH 02/44] py2 --> py3 --- ckanext/relation/plugin.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ckanext/relation/plugin.py b/ckanext/relation/plugin.py index 410cbd3..2468bb9 100644 --- a/ckanext/relation/plugin.py +++ b/ckanext/relation/plugin.py @@ -70,7 +70,7 @@ def get_child_package(id): relationships = p.toolkit.get_action("package_relationships_list")( data_dict={"id": id, "rel": "parent_of"} ) - except Exception, e: + except Exception as e: return {} children = [] @@ -99,7 +99,7 @@ def get_parent_package(id): relationships = p.toolkit.get_action("package_relationships_list")( data_dict={"id": id, "rel": "child_of"} ) - except Exception, e: + except Exception as e: return {} parents = [] @@ -118,7 +118,7 @@ def get_dependency_package(id): relationships = p.toolkit.get_action("package_relationships_list")( data_dict={"id": id, "rel": "depends_on"} ) - except Exception, e: + except Exception as e: return {} dependencies = [] @@ -139,7 +139,7 @@ def get_depend_package(id): relationships = p.toolkit.get_action("package_relationships_list")( data_dict={"id": id, "rel": "dependency_of"} ) - except Exception, e: + except Exception as e: return {} depend = [] @@ -168,7 +168,7 @@ def get_linked_package(id): relationships = p.toolkit.get_action("package_relationships_list")( data_dict={"id": id, "rel": "links_to"} ) - except Exception, e: + except Exception as e: return {} linked = [] @@ -190,7 +190,7 @@ def get_links_package(id): relationships = p.toolkit.get_action("package_relationships_list")( data_dict={"id": id, "rel": "linked_from"} ) - except Exception, e: + except Exception as e: return {} links = [] @@ -387,4 +387,4 @@ def i18n_domain(self): This implementation assumes the gettext domain is ckanext-{extension name}, hence your pot, po and mo files should be named ckanext-{extension name}.mo''' - return 'ckanext-{name}'.format(name=self.name) \ No newline at end of file + return 'ckanext-{name}'.format(name=self.name) From 8a68a82bd85a1148d62dfb72c5a8f70ea0a4a6f5 Mon Sep 17 00:00:00 2001 From: Marija <93824048+MarijaKnezevic@users.noreply.github.com> Date: Thu, 19 Jan 2023 12:09:19 +0100 Subject: [PATCH 03/44] Update controller.py --- ckanext/relation/controller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ckanext/relation/controller.py b/ckanext/relation/controller.py index 7b23be0..f830dac 100644 --- a/ckanext/relation/controller.py +++ b/ckanext/relation/controller.py @@ -3,7 +3,7 @@ from ckan.lib.base import BaseController import ckan.lib.helpers as h from ckan.common import OrderedDict, _, json, request, c, g, response, config -from urllib import urlencode +from urllib.parse import urlencode import cgi from paste.deploy.converters import asbool import ckan.logic as logic @@ -151,7 +151,7 @@ def new_resource_ext(self, id, data=None, errors=None, error_summary=None): # see if we have any data that we are trying to save data_provided = False - for key, value in data.iteritems(): + for key, value in data.items(): if ( value or isinstance(value, cgi.FieldStorage) ) and key != "resource_type": @@ -220,7 +220,7 @@ def new_resource_ext(self, id, data=None, errors=None, error_summary=None): get_action("resource_update")(context, data) else: get_action("resource_create")(context, data) - except ValidationError, e: + except ValidationError as e: errors = e.error_dict error_summary = e.error_summary return self.new_resource_ext(id, data, errors, error_summary) From c8ad0e1b84e2a540c223859771800fa22bbdab66 Mon Sep 17 00:00:00 2001 From: Marija <93824048+MarijaKnezevic@users.noreply.github.com> Date: Thu, 19 Jan 2023 12:15:11 +0100 Subject: [PATCH 04/44] Update plugin.py --- ckanext/relation/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/relation/plugin.py b/ckanext/relation/plugin.py index 2468bb9..9345d44 100644 --- a/ckanext/relation/plugin.py +++ b/ckanext/relation/plugin.py @@ -220,7 +220,7 @@ class RelationPlugin(p.SingletonPlugin): p.implements(p.ITranslation) p.implements(p.IConfigurable) p.implements(p.ITemplateHelpers) - p.implements(p.IRoutes, inherit=True) + p.implements(p.IBlueprint, inherit=True) package_link = "/dataset/" From b5011b76ad927c16048ca80ebee8dd1ce1db0f6b Mon Sep 17 00:00:00 2001 From: Marija <93824048+MarijaKnezevic@users.noreply.github.com> Date: Thu, 19 Jan 2023 16:18:35 +0100 Subject: [PATCH 05/44] Update resource_form.html --- ckanext/relation/templates/package/snippets/resource_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/relation/templates/package/snippets/resource_form.html b/ckanext/relation/templates/package/snippets/resource_form.html index 60849b3..196d9a2 100644 --- a/ckanext/relation/templates/package/snippets/resource_form.html +++ b/ckanext/relation/templates/package/snippets/resource_form.html @@ -2,7 +2,7 @@ {% set data = data or {} %} {% set errors = errors or {} %} -{% set action = form_action or h.url_for(c.linkResource) %} +{% set action = form_action or h.url_for(linkResource) %}