From 4bfa60185dd40b477b1941e590e530250d13a8e1 Mon Sep 17 00:00:00 2001 From: sudodoki Date: Tue, 26 Mar 2019 10:17:18 +0200 Subject: [PATCH] Fix issue with text import yielding internal server error on StopIteration --- app/server/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/server/utils.py b/app/server/utils.py index 38055ef4..439cc870 100644 --- a/app/server/utils.py +++ b/app/server/utils.py @@ -344,7 +344,7 @@ class PlainTextParser(FileParser): while True: batch = list(itertools.islice(file, IMPORT_BATCH_SIZE)) if not batch: - raise StopIteration + break yield [{'text': line.strip()} for line in batch]