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

Fix jinja expressions #835

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Fix jinja expressions #835

merged 2 commits into from
Sep 25, 2023

Conversation

sloschert
Copy link
Collaborator

fixes #832

I was not able to set Flask's jinja environment to "StrictUndefined" in arbeitszeit_flask/init.py because of an unexpected behaviour in flask-restx that is probably a bug. More on this bug: python-restx/flask-restx#565

More on "StrictUndefined": https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.StrictUndefined

But by activating this stricter environment "StrictUndefined" temporarily, I found and fixed some problematic lines of code.

Commits:

  • Fix wrong variable in coop summary template

  • Check in jinja expressions if var is defined
    In general it is more secure to check in jinja expressions if a variable is defined, not only if this variable is true. Two templates have been adapted accordingly.

Plan: fe6ed75b-5ad9-4821-a399-7ca8303e2fea

In general it is more secure to check in jinja expressions if a variable is defined, not only if this variable is true. Two templates have been adapted accordingly.
Copy link
Collaborator

@seppeljordan seppeljordan left a comment

Choose a reason for hiding this comment

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

cr

@sloschert sloschert merged commit 7436dbc into master Sep 25, 2023
4 checks passed
@sloschert sloschert deleted the sebas/fix-jinja-expressions branch September 25, 2023 16:13
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.

Cooperation summary: cooperator field is empty
2 participants