Commit 45bd0462 authored by Robin Sonnabend's avatar Robin Sonnabend

Improve error message if top.name is None

/close #196
parent 672a6434
......@@ -496,13 +496,20 @@ def parse_protocol_async_inner(protocol):
# TOPs
old_tops = list(protocol.tops)
for top in old_tops:
protocol.tops.remove(top)
tops = []
for index, fork in enumerate(
(child for child in tree.children if isinstance(child, Fork))):
top = TOP(
protocol_id=protocol.id, name=fork.name, number=index,
planned=False)
if top.name is None:
return _make_error(
protocol, "Parsing", "TOP-Name fehlt",
"'{Name' sollte '{TOP Name' lauten.")
tops.append(top)
for top in old_tops:
protocol.tops.remove(top)
for top in tops:
db.session.add(top)
db.session.commit()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment