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

Improve error message if top.name is None

/close #196
parent 672a6434
...@@ -496,13 +496,20 @@ def parse_protocol_async_inner(protocol): ...@@ -496,13 +496,20 @@ def parse_protocol_async_inner(protocol):
# TOPs # TOPs
old_tops = list(protocol.tops) old_tops = list(protocol.tops)
for top in old_tops: tops = []
protocol.tops.remove(top)
for index, fork in enumerate( for index, fork in enumerate(
(child for child in tree.children if isinstance(child, Fork))): (child for child in tree.children if isinstance(child, Fork))):
top = TOP( top = TOP(
protocol_id=protocol.id, name=fork.name, number=index, protocol_id=protocol.id, name=fork.name, number=index,
planned=False) 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.add(top)
db.session.commit() 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