Skip to content
Snippets Groups Projects
Commit 58039e1e authored by Hinrikus Wolf's avatar Hinrikus Wolf
Browse files

add priority for meta statements in sorted_statements

parent 58b06fe8
No related branches found
No related tags found
No related merge requests found
...@@ -86,9 +86,9 @@ class Topic(db.Model): ...@@ -86,9 +86,9 @@ class Topic(db.Model):
def sorted_statements(self): def sorted_statements(self):
statements = [statement for statement in self.statements if not statement.executed] statements = [statement for statement in self.statements if not statement.executed]
if self.mode == "fifo": 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": 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: else:
return statements return statements
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment