Skip to content

Add CKAN 2.10 compatable fucntions in plugin#16

Merged
blagojabozinovski merged 2 commits into
ckan-2.10-compatiblefrom
code-cleanup
Apr 1, 2024
Merged

Add CKAN 2.10 compatable fucntions in plugin#16
blagojabozinovski merged 2 commits into
ckan-2.10-compatiblefrom
code-cleanup

Conversation

@blagojabozinovski
Copy link
Copy Markdown

Adds async validation to CKAN 2.10

@blagojabozinovski blagojabozinovski merged commit 02eeacf into ckan-2.10-compatible Apr 1, 2024
return data_dict

def before_create(self, context, data_dict):
if ckan_2_10:
Copy link
Copy Markdown

@ThrawnCA ThrawnCA Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition shouldn't really be needed. The function can exist on 2.9, and be called when is_dataset is False (instead of duplicating its effects).

So you could have something like:

def before_resource_create(...):
    <do stuff>

def before_create(context, data_dict):
    if not self._data_dict_is_dataset(data_dict):
        return self.before_resource_create(context, data_dict)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThrawnCA can You please check this PR if this issue is implemented OK?

@blagojabozinovski blagojabozinovski deleted the code-cleanup branch May 17, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants