Skip to content

[#8316] Fix exception in ckan generate extension command #8437

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

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

amercader
Copy link
Member

Fixes #8316

In our post_gen_project hook, we were dumping the cookiecutter object as a Python object but using the jsonify filter. Cookicutter 2.6 introduced a new item in the context which is None by default, and this got translated as null when dumping it, which is not valid Python syntax.

I've refactored the hook a bit so it dumps the context in a bit more safely manner.

  • includes bugfix for possible backport

Fixes #8316

In our post_gen_project hook, we were dumping the cookiecutter object as
a Python object but using the `jsonify` filter. Cookicutter 2.6
introduced a new item in the context which is None by default, and this
got translated as `null` when dumping it, which is not valid Python
syntax.

I've refactored the hook a bit so it dumps the context in a bit more
safely manner.
@wardi wardi self-assigned this Sep 17, 2024
@amercader
Copy link
Member Author

@wardi I pushed some changes to handle any kind of value in the cookicutter context (and fixed the keys)

@amercader
Copy link
Member Author

@wardi see also #8456 (comment)

@wardi wardi merged commit 7e7f539 into master Oct 10, 2024
9 checks passed
@wardi wardi deleted the 8316-fix-cookiecutter branch October 10, 2024 14:10
@ckanbot
Copy link

ckanbot commented Oct 10, 2024

Successfully created backport PR for dev-v2.11:

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

Successfully merging this pull request may close these issues.

Extension generator post_gen_project hook script
3 participants