Skip to content

Commit

Permalink
Merge pull request #996 from psyray/fix-schedule-scan-page-not-displayed
Browse files Browse the repository at this point in the history
Add missing slug parameter in schedule scan
  • Loading branch information
yogeshojha committed Oct 24, 2023
2 parents 6e5ee8e + b01ffce commit 9a6d36b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions web/startScan/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
views.start_scan_ui,
name='start_scan'),
path(
'schedule/target/<int:host_id>',
'<slug:slug>/schedule/target/<int:host_id>',
views.schedule_scan,
name='schedule_scan'),
path(
'schedule/organization/<int:id>',
'<slug:slug>/schedule/organization/<int:id>',
views.schedule_organization_scan,
name='schedule_organization_scan'),
path(
Expand Down
4 changes: 2 additions & 2 deletions web/startScan/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def start_organization_scan(request, id, slug):


@has_permission_decorator(PERM_INITATE_SCANS_SUBSCANS, redirect_url=FOUR_OH_FOUR_URL)
def schedule_organization_scan(request, id):
def schedule_organization_scan(request, slug, id):
organization =Organization.objects.get(id=id)
if request.method == "POST":
engine_type = int(request.POST['scan_mode'])
Expand Down Expand Up @@ -796,7 +796,7 @@ def schedule_organization_scan(request, id):
messages.INFO,
f'Scan started for {ndomains} domains in organization {organization.name}'
)
return HttpResponseRedirect(reverse('scheduled_scan_view'))
return HttpResponseRedirect(reverse('scheduled_scan_view', kwargs={'slug': slug, 'id': id}))

# GET request
engine = EngineType.objects
Expand Down
2 changes: 1 addition & 1 deletion web/targetApp/templates/organization/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</a>
{% endif %}
{% if user|can:'initiate_scans_subscans' %}
<a href="{% url 'schedule_organization_scan' organization.id %}" class="open-domain" data-toggle="tooltip" data-placement="top" title="Schedule Scan">
<a href="{% url 'schedule_organization_scan' current_project.slug organization.id %}" class="open-domain" data-toggle="tooltip" data-placement="top" title="Schedule Scan">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-watch table-schedule"><circle cx="12" cy="12" r="7"></circle><polyline points="12 9 12 12 13.5 13.5"></polyline><path d="M16.51 17.35l-.35 3.83a2 2 0 0 1-2 1.82H9.83a2 2 0 0 1-2-1.82l-.35-3.83m.01-10.7l.35-3.83A2 2 0 0 1 9.83 1h4.35a2 2 0 0 1 2 1.82l.35 3.83"></path></svg>
</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion web/targetApp/templates/target/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ <h4 class="headline-title">Filters</h4>
<i class="mdi mdi-chevron-right"></i>
</button>
<div class="dropdown-menu" style="">
<a class="dropdown-item" href="/scan/schedule/target/${row.id}"><i class="fe-clock"></i>&nbsp;&nbsp;Schedule Scan</a>
<a class="dropdown-item" href="/scan/{{slug}}/schedule/target/${row.id}"><i class="fe-clock"></i>&nbsp;&nbsp;Schedule Scan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/target/{{slug}}/update/target/${row.id}"><i class="fe-edit-2"></i>&nbsp;&nbsp;Edit Target</a>
<a class="dropdown-item text-danger" href="#" onclick="delete_target(${row.id}, '${row.name}')"><i class="fe-trash-2"></i>&nbsp;&nbsp;Delete target</a>
Expand Down

0 comments on commit 9a6d36b

Please sign in to comment.