From 4674cf18b79c83fc245e2c91e43c4946714fbeb7 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 13 Jul 2023 18:32:14 +0200 Subject: [PATCH] fix check for applying fixes --- rook/director/director.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/rook/director/director.py b/rook/director/director.py index f8ef869..cb3500f 100644 --- a/rook/director/director.py +++ b/rook/director/director.py @@ -45,14 +45,15 @@ def __init__(self, coll, inputs): self._resolve() # if enabled for the project then check if a fix will be applied - if CONFIG[f"project:{self.project}"].get("use_fixes", False): - self._check_apply_fixes() - else: - self.inputs["apply_fixes"] = False + self._check_apply_fixes() + + def use_fixes(self): + return CONFIG[f"project:{self.project}"].get("use_fixes", False) def _check_apply_fixes(self): if ( - self.inputs.get("apply_fixes") + self.use_fixes() + and self.inputs.get("apply_fixes") and not self.use_original_files and self.requires_fixes() ): @@ -117,6 +118,9 @@ def _resolve(self): # If we got here: then WPS will be used, because `self.use_original_files == False` def requires_fixes(self): + if not self.use_fixes(): + return False + if self.search_result: ds_ids = self.search_result.files() else: