dav_base.templatetags.include_if_exist: fixed typos

This commit is contained in:
2026-05-26 11:54:18 +02:00
parent 6b9c490f92
commit e6c0c56403
+2 -2
View File
@@ -10,7 +10,7 @@ def do_include_if_exist(parser, token):
include_if_exist support an optional keyword 'default', which must be followed by the name of a default template.
The default template will be included, if the first template does not exist.
If also the default template does not exist, the behaviour is the same as for the original (builtin) include tag.
If also the default template does not exist, the behavior is the same as for the original (builtin) include tag.
If no default template is given and the first template does not exist an empty string will be returned.
"""
@@ -27,7 +27,7 @@ def do_include_if_exist(parser, token):
token = template.base.Token(token.token_type, ' '.join(bits))
token2 = template.base.Token(token.token_type, bits[0] + ' ' + default_template + ' '.join(bits[2:]))
default_node = template.loader_tags.do_include(parser, token2)
# TODO: I belive, this ist not the correct way to do things.
# TODO: I believe, this ist not the correct way to do things.
# But without setting default_node.origin here the following AttributeError will be risen within the tests:
# AttributeError: 'IncludeNode' object has no attribute 'origin'
default_node.origin = template.Origin(name='<unknown_source>', template_name=None)