Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CKAN 2.10 compatable fucntions in plugin #16

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

blagojabozinovski
Copy link

Adds async validation to CKAN 2.10

@blagojabozinovski blagojabozinovski merged commit 02eeacf into ckan-2.10-compatible Apr 1, 2024
2 of 4 checks passed
@@ -153,12 +155,19 @@ def _process_schema_fields(self, data_dict):

return data_dict

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

@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
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