Skip to content

Commit

Permalink
Fix yield-in-for-loop
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Jul 8, 2024
1 parent 073a9f8 commit af3c04c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions flower/utils/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ def sort_tasks(tasks, sort_by):
if sort_by.startswith('-'):
sort_by = sort_by.lstrip('-')
reverse = True
for task in sorted(
yield from sorted(
tasks,
key=lambda x: getattr(x[1], sort_by) or sort_keys[sort_by](),
reverse=reverse):
yield task
reverse=reverse)


def get_task_by_id(events, task_id):
Expand Down

0 comments on commit af3c04c

Please sign in to comment.