Skip to content

Commit

Permalink
Reintroduce task check in reschedule_task method that was removed by a
Browse files Browse the repository at this point in the history
merge conflict
  • Loading branch information
Donnype committed Oct 1, 2024
1 parent c1e7584 commit 5e5bbc0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rocky/rocky/views/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from octopoes.models import OOI
from octopoes.models.ooi.reports import ReportRecipe
from rocky.scheduler import Boefje as SchedulerBoefje
from rocky.scheduler import Boefje as SchedulerBoefje, SchedulerTaskNotFound
from rocky.scheduler import (
BoefjeTask,
LazyTaskList,
Expand Down Expand Up @@ -194,6 +194,14 @@ def reschedule_task(self, task_id: str) -> None:
try:
task = self.scheduler_client.get_task_details(task_id)

if task.type == "normalizer":
organization = task.data.raw_data.boefje_meta.organization
else:
organization = task.data.organization

if organization != self.organization.code:
raise SchedulerTaskNotFound()

new_id = uuid.uuid4()
task.data.id = new_id

Expand Down

0 comments on commit 5e5bbc0

Please sign in to comment.