Skip to content

Commit bccd795

Browse files
post processing: check for finding==None (#12713)
1 parent f1ff78a commit bccd795

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

dojo/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __wrapper__(*args, **kwargs):
106106
try:
107107
instance = model.objects.get(id=model_or_id)
108108
except model.DoesNotExist:
109-
logger.debug("error instantiating model_or_id: %s for model: %s: DoesNotExist", model_or_id, model)
109+
logger.warning("error instantiating model_or_id: %s for model: %s: DoesNotExist", model_or_id, model)
110110
instance = None
111111
args = list(args)
112112
args[parameter] = instance

dojo/finding/helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ def add_findings_to_auto_group(name, findings, group_by, *, create_finding_group
351351
def post_process_finding_save(finding, dedupe_option=True, rules_option=True, product_grading_option=True, # noqa: FBT002
352352
issue_updater_option=True, push_to_jira=False, user=None, *args, **kwargs): # noqa: FBT002 - this is bit hard to fix nice have this universally fixed
353353

354+
if not finding:
355+
logger.warning("post_process_finding_save called with finding==None, skipping post processing")
356+
return
357+
354358
system_settings = System_Settings.objects.get()
355359

356360
# STEP 1 run all status changing tasks sequentially to avoid race conditions

0 commit comments

Comments
 (0)