Skip to content

Commit

Permalink
escape(error) (#3343)
Browse files Browse the repository at this point in the history
* escape(error)

* fix TestPublicHandler
  • Loading branch information
antgonza authored Jan 3, 2024
1 parent b0d12fb commit b021f8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions qiita_pet/templates/error.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{% extends sitebase.html %}
{% autoescape None %}
{% block content%}
<h1 style="text-align:center">ERROR: CODE {{status_code}}!</h1>
<h2 style="text-align:center">{{error}}!</h2>
<h2 style="text-align:center">{% raw escape(error) %}</h2>
<p style="text-align:center">The error has been logged and will be looked at.</p>
<p style="text-align:center">Need help? Send us an <a href="mailto:qiita.help@gmail.com">email</a>.</p>
{% if is_admin %}
Expand Down
6 changes: 3 additions & 3 deletions qiita_pet/test/test_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ def test_public(self):

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

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

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

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


Expand Down

0 comments on commit b021f8a

Please sign in to comment.