Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Not able to add todo from All Subdomains Section Fixes #1310 #1314

Merged
merged 3 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions web/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ def post(self, request):
data = req.data

subdomain_id = data.get('subdomain_id')
scan_history_id = data.get('scan_history_id')
title = data.get('title')
description = data.get('description')
project = data.get('project')
Expand All @@ -577,10 +576,6 @@ def post(self, request):
note.title = title
note.description = description

if scan_history_id:
scan_history = ScanHistory.objects.get(id=scan_history_id)
note.scan_history = scan_history

# get scan history for subdomain_id
if subdomain_id:
subdomain = Subdomain.objects.get(id=subdomain_id)
Expand Down
10 changes: 6 additions & 4 deletions web/recon_note/static/note/js/todo.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,20 @@ function populateTodofunction(project=null){
'description': $_taskDescriptionText
}

if ($("#scanHistoryIDropdown").val() && $("#scanHistoryIDropdown").val() != 'Choose Scan History...') {
data['scan_history'] = parseInt($("#scanHistoryIDropdown").val());
}
// if ($("#scanHistoryIDropdown").val() && $("#scanHistoryIDropdown").val() != 'Choose Scan History...') {
// data['scan_history'] = parseInt($("#scanHistoryIDropdown").val());
// }

if ($("#subdomainDropdown").val() != 'Choose Subdomain...') {
data['subdomain'] = parseInt($("#subdomainDropdown").val());
data['subdomain_id'] = parseInt($("#subdomainDropdown").val());
}

if (project) {
data['project'] = project;
}

console.log(data);

fetch('/api/add/recon_note/', {
method: 'post',
headers: {
Expand Down
4 changes: 2 additions & 2 deletions web/startScan/static/startScan/js/detail_scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -1173,16 +1173,16 @@ function add_note_for_subdomain_handler(subdomain_id){
var title = document.getElementById('subdomainTodoTitle').value;
var description = document.getElementById('subdomainTodoDescription').value;
var project = document.querySelector('input[name="current_project"]').value;
var scan_id = parseInt(document.getElementById('summary_identifier_val').value);

data = {
'title': title,
'description': description,
'subdomain_id': subdomain_id,
'project': project,
'scan_history_id': scan_id
}

console.log(data);

fetch('/api/add/recon_note/', {
method: 'post',
headers: {
Expand Down
Loading