Fixed Report Download domain name

This commit is contained in:
Yogesh Ojha
2022-04-24 22:57:31 +05:30
parent 9a97e5fed8
commit 5b2b867ac2
2 changed files with 4 additions and 6 deletions
@@ -175,7 +175,7 @@
{% endif %}
{% if scan.scan_status != -1%}
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item text-dark" onclick="initiate_report({{scan_history.id}}, '{{scan_history.subdomain_discovery}}', '{{scan_history.vulnerability_scan}}')">
<a href="#" class="dropdown-item text-dark" onclick="initiate_report({{scan_history.id}}, '{{scan_history.subdomain_discovery}}', '{{scan_history.vulnerability_scan}}', '{{ scan_history.domain.name }}')">
<i class="fe-download"></i>&nbsp;Download Report</a>
{% endif %}
</div>
@@ -455,7 +455,7 @@
}
}
function initiate_report(id, is_subdomain_scan, is_vulnerability_scan) {
function initiate_report(id, is_subdomain_scan, is_vulnerability_scan, domain_name) {
$('#generateReportModal').modal('show');
$('#report_alert_message').empty();
$('#report_type_select').empty();
@@ -492,10 +492,10 @@
}));
}
$('#generateReportButton').attr('onClick', `generate_report(${id})`);
$('#generateReportButton').attr('onClick', `generate_report(${id}, '${domain_name}')`);
}
function generate_report(id) {
function generate_report(id, domain_name) {
var report_type = $("#report_type_select option:selected").val();
$('#generateReportModal').modal('hide');
swal.queue([{
-2
View File
@@ -724,8 +724,6 @@ def create_report(request, id):
html = template.render(data)
pdf = HTML(string=html).write_pdf()
print(report_type)
if 'download' in request.GET:
response = HttpResponse(pdf, content_type='application/octet-stream')
else: