Skip to content

Commit b021f8a

Browse files
authored
escape(error) (#3343)
* escape(error) * fix TestPublicHandler
1 parent b0d12fb commit b021f8a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

qiita_pet/templates/error.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{% extends sitebase.html %}
2-
{% autoescape None %}
32
{% block content%}
43
<h1 style="text-align:center">ERROR: CODE {{status_code}}!</h1>
5-
<h2 style="text-align:center">{{error}}!</h2>
4+
<h2 style="text-align:center">{% raw escape(error) %}</h2>
65
<p style="text-align:center">The error has been logged and will be looked at.</p>
76
<p style="text-align:center">Need help? Send us an <a href="mailto:[email protected]">email</a>.</p>
87
{% if is_admin %}

qiita_pet/test/test_public.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ def test_public(self):
2121

2222
response = self.get('/public/?study_id=100')
2323
self.assertEqual(response.code, 422)
24-
self.assertIn("Study 100 doesn't exist",
24+
self.assertIn("Study 100 doesn&#39;t exist",
2525
response.body.decode('ascii'))
2626

2727
response = self.get('/public/?artifact_id=100')
2828
self.assertEqual(response.code, 422)
29-
self.assertIn("Artifact 100 doesn't exist",
29+
self.assertIn("Artifact 100 doesn&#39;t exist",
3030
response.body.decode('ascii'))
3131

3232
response = self.get('/public/?artifact_id=1')
@@ -58,7 +58,7 @@ def test_public(self):
5858

5959
response = self.get('/public/?artifact_id=8')
6060
self.assertEqual(response.code, 422)
61-
self.assertIn("Artifact 8 doesn't belong to a study",
61+
self.assertIn("Artifact 8 doesn&#39;t belong to a study",
6262
response.body.decode('ascii'))
6363

6464

0 commit comments

Comments
 (0)