From b01ffceadf3f1a4fae70746bac2cec024d978fc3 Mon Sep 17 00:00:00 2001 From: Raynald Date: Sat, 21 Oct 2023 18:23:41 +0200 Subject: [PATCH] Fix schedule organization scan --- web/startScan/urls.py | 2 +- web/startScan/views.py | 4 ++-- web/targetApp/templates/organization/list.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/startScan/urls.py b/web/startScan/urls.py index e5781277..31054f06 100644 --- a/web/startScan/urls.py +++ b/web/startScan/urls.py @@ -51,7 +51,7 @@ urlpatterns = [ views.schedule_scan, name='schedule_scan'), path( - 'schedule/organization/', + '/schedule/organization/', views.schedule_organization_scan, name='schedule_organization_scan'), path( diff --git a/web/startScan/views.py b/web/startScan/views.py index cfc4d5a0..182aaffb 100644 --- a/web/startScan/views.py +++ b/web/startScan/views.py @@ -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']) @@ -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 diff --git a/web/targetApp/templates/organization/list.html b/web/targetApp/templates/organization/list.html index 3b488b89..092f5adf 100644 --- a/web/targetApp/templates/organization/list.html +++ b/web/targetApp/templates/organization/list.html @@ -65,7 +65,7 @@ Organizations {% endif %} {% if user|can:'initiate_scans_subscans' %} - + {% endif %}