Skip to content

Commit

Permalink
Merge pull request #62 from TeskaLabs/Enhancement/Add-library-bad-tem…
Browse files Browse the repository at this point in the history
…plates

Bad templates to be stored in library
  • Loading branch information
mithunbharadwaj authored Feb 8, 2024
2 parents 7f756f1 + 0b76a87 commit df08813
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/Templates/Attachment/syntax_error_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{# Incorrect Jinja2 syntax (missing endfor) which will raise a TemplateSyntaxError #}
{% for item in some_list %}
{{ item }}
{# Missing {% endfor %} here #}
14 changes: 14 additions & 0 deletions library/Templates/Attachment/undefined_variable_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Undefined Error Example</title>
</head>
<body>
<h1>Attempting to Access an Undefined Variable</h1>
<p>
{# Accessing an undefined variable here #}
{{ non_existent_variable + non_existent_variable }}
</p>
</body>
</html>
4 changes: 4 additions & 0 deletions library/Templates/Email/syntax_error_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{# Incorrect Jinja2 syntax (missing endfor) which will raise a TemplateSyntaxError #}
{% for item in some_list %}
{{ item }}
{# Missing {% endfor %} here #}
14 changes: 14 additions & 0 deletions library/Templates/Email/undefined_variable_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Undefined Error Example</title>
</head>
<body>
<h1>Attempting to Access an Undefined Variable</h1>
<p>
{# Accessing an undefined variable here #}
{{ non_existent_variable + non_existent_variable }}
</p>
</body>
</html>
4 changes: 4 additions & 0 deletions library/Templates/General/syntax_error_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{# Incorrect Jinja2 syntax (missing endfor) which will raise a TemplateSyntaxError #}
{% for item in some_list %}
{{ item }}
{# Missing {% endfor %} here #}
14 changes: 14 additions & 0 deletions library/Templates/General/undefined_variable_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Undefined Error Example</title>
</head>
<body>
<h1>Attempting to Access an Undefined Variable</h1>
<p>
{# Accessing an undefined variable here #}
{{ non_existent_variable + non_existent_variable }}
</p>
</body>
</html>
4 changes: 4 additions & 0 deletions library/Templates/MSTeams/syntax_error_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{# Incorrect Jinja2 syntax (missing endfor) which will raise a TemplateSyntaxError #}
{% for item in some_list %}
{{ item }}
{# Missing {% endfor %} here #}
4 changes: 4 additions & 0 deletions library/Templates/Slack/syntax_error_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{# Incorrect Jinja2 syntax (missing endfor) which will raise a TemplateSyntaxError #}
{% for item in some_list %}
{{ item }}
{# Missing {% endfor %} here #}
2 changes: 2 additions & 0 deletions library/Templates/Slack/undefined_variable_error.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{# Attempt to access an undefined variable, which will raise an UndefinedError in Jinja2 #}
{{ non_existent_variable + non_existent_variable }}

0 comments on commit df08813

Please sign in to comment.