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

Refactor DOIPlugin to only flash success messages in blueprint views #102

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

MarkCalvert
Copy link

The reason behind this change is to handle when CKAN background jobs update datasets (e.g. embargo releases) which trigger the after_dataset_update interface.
Flash messages will fail in background jobs and only work from web requests.
The solution is to check if the request has come from a blueprint view.

Copy link
Member

@alycejenni alycejenni left a comment

Choose a reason for hiding this comment

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

Hi @MarkCalvert, thanks for your PR!

  • trying to access toolkit.g is breaking the tests (specifically test_after_dataset_update in test_plugin.py)
  • if possible, it would be great if you could create a test that would check this setup (the background job)
  • please make sure you read the contributing guidelines for commits for your new commits

@alycejenni alycejenni changed the base branch from main to dev May 1, 2024 15:30
@alycejenni alycejenni self-assigned this May 1, 2024
@MarkCalvert
Copy link
Author

Hi @alycejenni ,
Sorry I was aware of that issue a while ago and forgot to merge the commit into this PR branch.
d1b65dc
I have run the tests locally and they now pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Blocked
Development

Successfully merging this pull request may close these issues.

2 participants