Skip to content

Commit 3b36a77

Browse files
committed
Refactor JIRA sync flag to use 'finding_jira_sync' for consistency in importers and reimporters
1 parent a033d44 commit 3b36a77

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

dojo/finding/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def post_process_findings_batch(
521521
jira_instance = JIRA_Instance.objects.get(id=jira_instance_id)
522522
# We dont check if the finding jira sync is applicable quite yet until we can get in the loop
523523
# but this is a way to at least make it that far
524-
if push_to_jira or getattr(jira_instance, "keep_findings_jira_sync", False):
524+
if push_to_jira or getattr(jira_instance, "finding_jira_sync", False):
525525
for finding in findings:
526526
object_to_push = finding if finding.has_jira_issue or not finding.finding_group else finding.finding_group
527527
# Check the push_to_jira flag again to potentially shorty circuit without checking for existing findings

dojo/importers/default_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def close_old_findings(
384384
# push finding groups to jira since we only only want to push whole groups
385385
# We dont check if the finding jira sync is applicable quite yet until we can get in the loop
386386
# but this is a way to at least make it that far
387-
if self.findings_groups_enabled and (self.push_to_jira or getattr(self.jira_instance, "keep_findings_jira_sync", False)):
387+
if self.findings_groups_enabled and (self.push_to_jira or getattr(self.jira_instance, "finding_jira_sync", False)):
388388
for finding_group in {finding.finding_group for finding in old_findings if finding.finding_group is not None}:
389389
# Check the push_to_jira flag again to potentially shorty circuit without checking for existing findings
390390
if self.push_to_jira or is_keep_in_sync_with_jira(finding_group, prefetched_jira_instance=self.jira_instance):

dojo/importers/default_reimporter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def close_old_findings(
501501
# push finding groups to jira since we only only want to push whole groups
502502
# We dont check if the finding jira sync is applicable quite yet until we can get in the loop
503503
# but this is a way to at least make it that far
504-
if self.findings_groups_enabled and (self.push_to_jira or getattr(self.jira_instance, "keep_findings_jira_sync", False)):
504+
if self.findings_groups_enabled and (self.push_to_jira or getattr(self.jira_instance, "finding_jira_sync", False)):
505505
for finding_group in {finding.finding_group for finding in findings if finding.finding_group is not None}:
506506
# Check the push_to_jira flag again to potentially shorty circuit without checking for existing findings
507507
if self.push_to_jira or is_keep_in_sync_with_jira(finding_group, prefetched_jira_instance=self.jira_instance):
@@ -990,14 +990,14 @@ def process_groups_for_all_findings(
990990
)
991991
# We dont check if the finding jira sync is applicable quite yet until we can get in the loop
992992
# but this is a way to at least make it that far
993-
if self.push_to_jira or getattr(self.jira_instance, "keep_findings_jira_sync", False):
993+
if self.push_to_jira or getattr(self.jira_instance, "finding_jira_sync", False):
994994
object_to_push = findings[0].finding_group if findings[0].finding_group is not None else findings[0]
995995
# Check the push_to_jira flag again to potentially shorty circuit without checking for existing findings
996996
if self.push_to_jira or is_keep_in_sync_with_jira(object_to_push, prefetched_jira_instance=self.jira_instance):
997997
jira_helper.push_to_jira(object_to_push)
998998
# We dont check if the finding jira sync is applicable quite yet until we can get in the loop
999999
# but this is a way to at least make it that far
1000-
if self.findings_groups_enabled and (self.push_to_jira or getattr(self.jira_instance, "keep_findings_jira_sync", False)):
1000+
if self.findings_groups_enabled and (self.push_to_jira or getattr(self.jira_instance, "finding_jira_sync", False)):
10011001
for finding_group in {
10021002
finding.finding_group
10031003
for finding in self.reactivated_items + self.unchanged_items

0 commit comments

Comments
 (0)