Skip to content

handle Undefined in get/select_template#1114

Merged
davidism merged 1 commit intomasterfrom
import-undefined
Dec 5, 2019
Merged

handle Undefined in get/select_template#1114
davidism merged 1 commit intomasterfrom
import-undefined

Conversation

@davidism
Copy link
Copy Markdown
Member

@davidism davidism commented Dec 5, 2019

fixes #1037

The value passed to extends, import, or include could be a variable, which could be undefined. Some loaders would incidentally trigger the UndefinedError, while others such as DictLoader would not, producing an unhelpful TemplateNotFound message.

Passing Undefined to get_template raises an UndefinedError. If select_template raises TemplatesNotFound, any undefined values in the list of attempts show as their undefined message rather than the empty string. get_or_select_template passes Undefined to get_template.

@davidism davidism added this to the 2.11.0 milestone Dec 5, 2019
@davidism davidism merged commit f81c744 into master Dec 5, 2019
@davidism davidism deleted the import-undefined branch December 5, 2019 21:50
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 13, 2020
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.

Error in printing exception with undefined variable in import statement

1 participant