From ab87c1c33f3a751d14f70ef36693298d74e02c06 Mon Sep 17 00:00:00 2001
From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de>
Date: Sun, 5 Nov 2017 19:32:15 +0100
Subject: [PATCH] Don't show empty protocol content

---
 server.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server.py b/server.py
index 43fb3d2..0d1d7e2 100755
--- a/server.py
+++ b/server.py
@@ -532,7 +532,9 @@ def show_protocol(protocol):
     content_html = (protocol.content_html_private
         if protocol.has_private_view_right(user)
         else protocol.content_html_public)
-    return render_template("protocol-show.html", protocol=protocol, errors_table=errors_table, documents_table=documents_table, document_upload_form=document_upload_form, source_upload_form=source_upload_form, time_diff=time_diff, large_time_diff=large_time_diff, content_html=Markup(content_html))
+    if content_html is not None:
+        content_html = Markup(content_html)
+    return render_template("protocol-show.html", protocol=protocol, errors_table=errors_table, documents_table=documents_table, document_upload_form=document_upload_form, source_upload_form=source_upload_form, time_diff=time_diff, large_time_diff=large_time_diff, content_html=content_html)
 
 @app.route("/protocol/delete/<int:protocol_id>")
 @login_required
-- 
GitLab