Skip to content

Commit

Permalink
Merge pull request #35751 from dimagi/mjr/page-data-attribution
Browse files Browse the repository at this point in the history
Add correct error handling for page data nodes
  • Loading branch information
mjriley authored Feb 11, 2025
2 parents 18e6f64 + f4a3131 commit 45774a4
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 45774a4

Please sign in to comment.