You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor vulnerability ID and endpoint retrieval in Finding model (#13324)
* refactor: streamline vulnerability ID and endpoint retrieval in Finding model
* attempt to fetch saved objects first
* fix ruff
* Update dojo/models.py
* Update dojo/models.py
# deduplicate (usually done upon saving finding) and sort endpoints
2977
-
endpoint_str="".join(
2978
-
sorted(
2979
-
dict.fromkeys(endpoint_str_list)))
2980
-
else:
2981
-
# we can get here when the parser defines static_finding=True but leaves dynamic_finding defaulted
2982
-
# In this case, before saving the finding, both static_finding and dynamic_finding are True
2983
-
# After saving dynamic_finding may be set to False probably during the saving process (observed on Bandit scan before forcing dynamic_finding=False at parser level)
2984
-
deduplicationLogger.debug("trying to get endpoints on a finding before it was saved but no endpoints found (static parser wrongly identified as dynamic?")
2985
-
else:
2986
-
deduplicationLogger.debug("get_endpoints: after the finding was saved. Endpoints count: "+str(self.endpoints.count()))
2987
-
# convert list of endpoints to the list of their canonical representation
# we can get here when the parser defines static_finding=True but leaves dynamic_finding defaulted
2983
+
# In this case, before saving the finding, both static_finding and dynamic_finding are True
2984
+
# After saving dynamic_finding may be set to False probably during the saving process (observed on Bandit scan before forcing dynamic_finding=False at parser level)
2985
+
deduplicationLogger.debug("trying to get endpoints on a finding before it was saved but no endpoints found (static parser wrongly identified as dynamic?")
2986
+
return""
2987
+
2988
+
def_get_saved_endpoints(finding) ->str:
2989
+
iffinding.idisnotNone:
2990
+
deduplicationLogger.debug("get_endpoints: after the finding was saved. Endpoints count: "+str(finding.endpoints.count()))
2991
+
# convert list of endpoints to the list of their canonical representation
0 commit comments