Skip to content

Commit e2365c0

Browse files
committed
Refactor is_keep_in_sync_with_jira function to use a generic object parameter for improved flexibility
1 parent 3b36a77 commit e2365c0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

dojo/jira_link/helper.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,11 @@ def _safely_get_obj_status_for_jira(obj: Finding | Finding_Group, *, isenforced:
145145
return status or ["Inactive"]
146146

147147

148-
def is_keep_in_sync_with_jira(finding, prefetched_jira_instance: JIRA_Instance = None):
148+
def is_keep_in_sync_with_jira(obj: Finding | Finding_Group, prefetched_jira_instance: JIRA_Instance = None):
149149
keep_in_sync_enabled = False
150-
# Check if there is a jira issue that needs to be updated
151-
jira_issue_exists = finding.has_jira_issue or (finding.finding_group and finding.finding_group.has_jira_issue)
152-
if jira_issue_exists:
150+
if obj.has_jira_issue:
153151
# Determine if any automatic sync should occur
154-
jira_instance = prefetched_jira_instance or get_jira_instance(finding)
152+
jira_instance = prefetched_jira_instance or get_jira_instance(obj)
155153
if jira_instance:
156154
keep_in_sync_enabled = jira_instance.finding_jira_sync
157155

0 commit comments

Comments
 (0)