summaryrefslogtreecommitdiffstats
path: root/dashboard
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2019-06-14 09:48:56 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2019-06-14 10:56:31 -0400
commite76818db7ef630b04f07d0311b95ecc3053b0993 (patch)
tree5ae9736f3e64bfe7c21e562c8d6f58baf1317ca3 /dashboard
parent771613e9c9fae29cdf36e9e4390dbad672aa100b (diff)
Fix quick booking redirect
Change-Id: Icae87fa214d0085c9c68b5e3107eb250100d048b Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'dashboard')
-rw-r--r--dashboard/src/booking/quick_deployer.py2
-rw-r--r--dashboard/src/booking/views.py12
2 files changed, 8 insertions, 6 deletions
diff --git a/dashboard/src/booking/quick_deployer.py b/dashboard/src/booking/quick_deployer.py
index ac69c8c..98c535a 100644
--- a/dashboard/src/booking/quick_deployer.py
+++ b/dashboard/src/booking/quick_deployer.py
@@ -329,6 +329,8 @@ def create_from_form(form, request):
JobFactory.makeCompleteJob(booking)
NotificationHandler.notify_new_booking(booking)
+ return booking
+
def drop_filter(user):
installer_filter = {}
diff --git a/dashboard/src/booking/views.py b/dashboard/src/booking/views.py
index 13e9d01..bad7dc9 100644
--- a/dashboard/src/booking/views.py
+++ b/dashboard/src/booking/views.py
@@ -16,6 +16,7 @@ from django.views import View
from django.views.generic import TemplateView
from django.shortcuts import redirect, render
from django.db.models import Q
+from django.urls import reverse
from resource_inventory.models import ResourceBundle, HostProfile, Image, Host
from resource_inventory.resource_manager import ResourceManager
@@ -60,14 +61,13 @@ def quick_create(request):
if form.is_valid():
try:
- create_from_form(form, request)
+ booking = create_from_form(form, request)
+ messages.success(request, "We've processed your request. "
+ "Check Account->My Bookings for the status of your new booking")
+ return redirect(reverse('booking:booking_detail', kwargs={'booking_id': booking.id}))
except Exception as e:
messages.error(request, "Whoops, an error occurred: " + str(e))
- return render(request, 'workflow/exit_redirect.html', context)
-
- messages.success(request, "We've processed your request. "
- "Check Account->My Bookings for the status of your new booking")
- return render(request, 'workflow/exit_redirect.html', context)
+ return render(request, 'booking/quick_deploy.html', context)
else:
messages.error(request, "Looks like the form didn't validate. Check that you entered everything correctly")
return render(request, 'booking/quick_deploy.html', context)