From 5f889eff2d604cbb52b60428a215eb8e618559cc Mon Sep 17 00:00:00 2001
From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de>
Date: Mon, 6 Mar 2017 15:21:58 +0100
Subject: [PATCH] Add specific error if a protocol is imported from an empty
 etherpad. /close #27

---
 tasks.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tasks.py b/tasks.py
index 2832c4d..a214a47 100644
--- a/tasks.py
+++ b/tasks.py
@@ -95,6 +95,11 @@ def parse_protocol_async_inner(protocol, encoded_kwargs):
         db.session.add(error)
         db.session.commit()
         return
+    if protocol.source == config.EMPTY_ETHERPAD:
+        error = protocol.create_error("Parsing", "The etherpad is unmodified and does not contain a protocol.", protocol.source)
+        db.session.add(error)
+        db.session.commit()
+        return
     tree = None
     try:
         tree = parse(protocol.source)
-- 
GitLab