Skip to content

Commit

Permalink
types import for Context is now ckan version sensitiv
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hanke committed Mar 14, 2024
1 parent 3e7e17c commit 5a489ba
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ckanext/csvwmapandtransform/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckan import model
from ckan.lib.plugins import DefaultTranslation

if toolkit.check_ckan_version("2.10"):
from ckan.types import Context
Expand All @@ -13,8 +14,6 @@ def __init__(self, **kwargs):
super().__init__(**kwargs)


from ckan.lib.plugins import DefaultTranslation

from typing import Any

from ckanext.csvwmapandtransform import action, helpers, auth, views
Expand Down Expand Up @@ -57,7 +56,7 @@ def update_config(self, config_):
# IResourceUrlChange

def notify(self, resource: model.Resource):
context: {"ignore_auth": True}
context: Context = {"ignore_auth": True}
resource_dict = toolkit.get_action("resource_show")(
context,
{
Expand All @@ -76,10 +75,10 @@ def after_create(self, context, resource_dict):
# def before_show(self, resource_dict):
# self.before_resource_show(resource_dict)

def after_update(self, context, resource_dict: dict[str, Any]):
def after_update(self, context: Context, resource_dict: dict[str, Any]):
self._sumbit_transform(resource_dict)

def after_resource_create(self, context, resource_dict: dict[str, Any]):
def after_resource_create(self, context: Context, resource_dict: dict[str, Any]):
self._sumbit_transform(resource_dict)

def _sumbit_transform(self, resource_dict: dict[str, Any]):
Expand Down

0 comments on commit 5a489ba

Please sign in to comment.