refactor to remove config_files in favor of db
This commit is contained in:
@@ -198,12 +198,12 @@ def scan_history(scan_id):
|
||||
if not reference_scan:
|
||||
return jsonify({'error': 'Scan not found'}), 404
|
||||
|
||||
config_file = reference_scan.config_file
|
||||
config_id = reference_scan.config_id
|
||||
|
||||
# Query historical scans with the same config file
|
||||
# Query historical scans with the same config_id
|
||||
historical_scans = (
|
||||
db_session.query(Scan)
|
||||
.filter(Scan.config_file == config_file)
|
||||
.filter(Scan.config_id == config_id)
|
||||
.filter(Scan.status == 'completed')
|
||||
.order_by(Scan.timestamp.desc())
|
||||
.limit(limit)
|
||||
@@ -247,7 +247,7 @@ def scan_history(scan_id):
|
||||
'scans': scans_data,
|
||||
'labels': labels,
|
||||
'port_counts': port_counts,
|
||||
'config_file': config_file
|
||||
'config_id': config_id
|
||||
}), 200
|
||||
|
||||
except SQLAlchemyError as e:
|
||||
|
||||
Reference in New Issue
Block a user