Skip to content

Commit

Permalink
Merge pull request #250 from lzaoral/hub-remove-extra-newline-in-logs
Browse files Browse the repository at this point in the history
hub: do not insert extra newlines to logs on page reloads
  • Loading branch information
rohanpm authored Mar 14, 2024
2 parents 313d553 + 84a0531 commit 88237f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions kobo/hub/templates/task/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@
<h2>{% trans 'Task' %} #{{ task.id }} - {{ log_name }}</h2>
<a href="{% url 'task/detail' task.id %}">{% trans "back to task" %} #{{ task.id }}</a><br />
<a href="?format=raw">{% trans 'download' %}</a>
<pre class="log" id="log">
{{ content }}
</pre>

<pre class="log" id="log">{{ content }}</pre>
{% endblock %}
4 changes: 2 additions & 2 deletions tests/test_view_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_view_html_wrapped(self):
# The response is expected to be wrapped in some view.
# We are only doing a very basic verification of the view here
self.assertTrue(content.startswith('<!DOCTYPE html'))
self.assertTrue((small_log_content() + "\n</pre>") in content, content)
self.assertTrue((small_log_content() + "</pre>") in content, content)

# No trimming necessary
self.assertFalse('...trimmed, download required for full log' in content)
Expand All @@ -210,7 +210,7 @@ def test_view_tiny_html_wrapped(self):
)

self.assertTrue(content.startswith('<!DOCTYPE html'))
self.assertTrue((tiny_log_content() + "\n</pre>") in content, content)
self.assertTrue((tiny_log_content() + "</pre>") in content, content)
self.assertFalse('...trimmed, download required for full log' in content)

@profile
Expand Down

0 comments on commit 88237f2

Please sign in to comment.