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

Don't process extra resources on resource_create #74

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amercader
Copy link
Member

In async mode, if a dataset already has one or more resources suitable for validation, when adding a new one all the previous ones are also sent to validate.

@ThrawnCA patch in #67, dealt with the same scenario but when updating an existing resource.

In this case sadly we need to use the context, as there is no way to reliably tell in after_update if it's part of a resource_create call

In async mode, if a dataset already has one or more resources suitable
for validation, when adding a new one all the previous ones are also
sent to validate.

@ThrawnCA patch in #67, dealt with the same scenario but when updating
an existing resource.

In this case sadly we need to use the context, as there is no way to
reliably tell in `after_update` if it's part of a resource_create call
@amercader amercader marked this pull request as draft October 27, 2022 14:17
if is_dataset:
return self._process_schema_fields(data_dict)
else:
context["_resource_create_call"] = True
Copy link
Contributor

Choose a reason for hiding this comment

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

CKAN 2.10 will restrict the allowed context keys...

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.

3 participants