Skip to content

fix: provide settings to render_to_string for IPR notification emails#4357

Merged
rjsparks merged 3 commits into
ietf-tools:mainfrom
larseggert:fix-4340
Aug 26, 2022
Merged

fix: provide settings to render_to_string for IPR notification emails#4357
rjsparks merged 3 commits into
ietf-tools:mainfrom
larseggert:fix-4340

Conversation

@larseggert

Copy link
Copy Markdown
Collaborator

Fixes #4340

@rjsparks

Copy link
Copy Markdown
Member

Something more subtle is wrong here.
This kind of PR needs to come with updates to the tests.
All templates already have access to settings per
https://github.com/ietf-tools/datatracker/blob/main/ietf/context_processors.py#L44
which is installed at
https://github.com/ietf-tools/datatracker/blob/main/ietf/settings.py#L372
so if these changes in this PR are actually having an effect, something is broken with that setup.
This needs more investigation.

@rjsparks rjsparks self-assigned this Aug 25, 2022
@rjsparks
rjsparks self-requested a review August 25, 2022 15:13
@rjsparks

Copy link
Copy Markdown
Member

So, this is because we're not passing a Request (with its associated RequestContext) to render_to_string, so a simple Context is being used instead, and the context processor linked above doesn't operate on that.

This fix is certainly quicker than reworking the plumbing such that these functions get a request to work with.

But the PR still needs an updated test. I can help build one.

@larseggert

Copy link
Copy Markdown
Collaborator Author

If you get something started, I can pick it up.

@rjsparks rjsparks changed the title Pass settings into the context fix: provide settings to render_to_string for IPR notification emails Aug 26, 2022
@rjsparks
rjsparks removed their request for review August 26, 2022 19:10
@rjsparks
rjsparks merged commit 088d953 into ietf-tools:main Aug 26, 2022
@larseggert
larseggert deleted the fix-4340 branch August 29, 2022 06:45
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDTRACKER_BASE_URL missing from IPR email

3 participants