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

Add correct error handling for page data nodes #35751

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions corehq/apps/hqwebapp/templatetags/hq_shared_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,15 @@ def html_attr(value):
return conditional_escape(value)


def _create_page_data(parser, token, node_slug):
split_contents = token.split_contents()
def _create_page_data(parser, original_token, node_slug):
split_contents = original_token.split_contents()
tag = split_contents[0]
name = parse_literal(split_contents[1], parser, tag)
value = parser.compile_filter(split_contents[2])

class FakeNode(template.Node):
# must mock token or error handling code will fail and not reveal real error
token = Token(TokenType.TEXT, '', (0, 0), 0)
token = original_token
origin = parser.origin

def render(self, context):
resolved = value.resolve(context)
Expand Down
Loading