Skip to content

Commit

Permalink
Merge pull request #119 from intezer/fix/fallback-latest
Browse files Browse the repository at this point in the history
Fix/fallback latest url analysis - TKT-1220
  • Loading branch information
matany90 authored Oct 18, 2023
2 parents 1ab8757 + e291047 commit 9fef251
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.19.5
------
- Latest URL analysis fallback.

1.19.4
------
- Add global API custom instance setter.
Expand Down
2 changes: 1 addition & 1 deletion intezer_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.19.4'
__version__ = '1.19.5'
5 changes: 3 additions & 2 deletions intezer_sdk/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,12 @@ def from_latest_analysis(cls,
api=api)
all_analyses_reports = analysis_history_url_result.all()


analyses_ids = [report['analysis_id'] for report in all_analyses_reports
if url in (report['scanned_url'], report['submitted_url'])]
if url in (report.get('scanned_url'), report.get('submitted_url'))]
if not analyses_ids and not exact_match:
analyses_ids = [report['analysis_id'] for report in all_analyses_reports
if _clean_url(url) in (_clean_url(report['scanned_url']), _clean_url(report['submitted_url']))]
if _clean_url(url) in (_clean_url(report.get('scanned_url', '')), _clean_url(report.get('submitted_url', '')))]

if not analyses_ids:
return None
Expand Down

0 comments on commit 9fef251

Please sign in to comment.