Skip to content

Commit

Permalink
Allow setting priority 0 for resubmitted tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyzheng committed Jan 12, 2021
1 parent b2e508f commit d7572bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kobo/client/commands/cmd_resubmit_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def run(self, *args, **kwargs):
failed = False
for task_id in tasks:
try:
resubmitted_id = self.hub.client.resubmit_task(task_id, *[arg for arg in [force, priority] if arg])
resubmitted_id = self.hub.client.resubmit_task(task_id, force, *[arg for arg in [priority] if arg is not None])
resubmitted_tasks.append(resubmitted_id)
except Exception as ex:
failed = True
Expand Down
3 changes: 1 addition & 2 deletions kobo/hub/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,7 @@ def resubmit_task(self, user, force=False, priority=None):
"worker_name": None,
"arch_name": self.arch.name,
"channel_name": self.channel.name,
"priority": self.priority,
"priority": priority if priority else self.priority,
"priority": priority if priority is not None else self.priority,
"weight": self.weight,
"exclusive": self.exclusive,
"resubmitted_by": user,
Expand Down

0 comments on commit d7572bb

Please sign in to comment.