Commit 58039e1e authored by Hinrikus Wolf's avatar Hinrikus Wolf

add priority for meta statements in sorted_statements

parent 58b06fe8
......@@ -86,9 +86,9 @@ class Topic(db.Model):
def sorted_statements(self):
statements = [statement for statement in self.statements if not statement.executed]
if self.mode == "fifo":
return sorted(statements, key=lambda st: st.id)
return sorted(statements, key=lambda st: -1 if st.is_meta else st.id)
elif self.mode == "balanced":
return sorted(statements, key=lambda st: st.speaker.count(self))
return sorted(statements, key=lambda st: -1 if st.is_meta else st.speaker.count(self))
else:
return statements
......
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