Skip to content

chore(generator): use {% set %} to extract repeated logic in conditionals#17890

Merged
hebaalazzeh merged 1 commit into
mainfrom
global-variable-autopop-fields
Jul 24, 2026
Merged

chore(generator): use {% set %} to extract repeated logic in conditionals#17890
hebaalazzeh merged 1 commit into
mainfrom
global-variable-autopop-fields

Conversation

@hebaalazzeh

@hebaalazzeh hebaalazzeh commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Updating the use of global variable for auto populated fields, we are making sure that the Jinja variables are defined at the top of the file so they can easily reference throughout the template.

@hebaalazzeh hebaalazzeh self-assigned this Jul 24, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors several Jinja2 templates to pre-calculate whether a service has auto-populated fields, replacing complex inline filters with a simpler boolean variable. The review feedback correctly points out that defining variables and executing loops before the {% extends %} tag violates Jinja2 standards, which can lead to syntax errors or scoping issues. It is recommended to move these variable definitions and loops inside the {% block content %} block to ensure correct rendering and compliance.

@hebaalazzeh
hebaalazzeh force-pushed the global-variable-autopop-fields branch 5 times, most recently from 5ebf4bf to 2360399 Compare July 24, 2026 17:14
@hebaalazzeh
hebaalazzeh marked this pull request as ready for review July 24, 2026 17:15
@hebaalazzeh
hebaalazzeh requested a review from a team as a code owner July 24, 2026 17:15
@hebaalazzeh
hebaalazzeh force-pushed the global-variable-autopop-fields branch from 2360399 to 69cc49e Compare July 24, 2026 17:37
@ohmayr ohmayr changed the title chore(generator): use global var for autopopulated fields chore(generator): use {% set %} to extract repeated logic in conditionals Jul 24, 2026
@ohmayr ohmayr changed the title chore(generator): use {% set %} to extract repeated logic in conditionals chore(generator): use {% set %} to extract repeated logic in conditionals Jul 24, 2026
@hebaalazzeh
hebaalazzeh merged commit adba9fd into main Jul 24, 2026
98 of 99 checks passed
@hebaalazzeh
hebaalazzeh deleted the global-variable-autopop-fields branch July 24, 2026 17:51
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.

2 participants