diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2021-09-30 10:02:32 -0400 |
---|---|---|
committer | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2021-09-30 10:02:59 -0400 |
commit | d55551394df73645e49ae2ae3e730a9f1c6af81d (patch) | |
tree | 3cb5ab91121af518a6251197806dbb9c3f99b2a0 /src/booking | |
parent | 95d39c60f7e8062cabc8c1665080a2d2c8904234 (diff) |
Better error handling for quick deploy
Change-Id: I03a725dfee9ce2f119d72ef940cd08df5aee3dcc
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/booking')
-rw-r--r-- | src/booking/quick_deployer.py | 2 | ||||
-rw-r--r-- | src/booking/views.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/booking/quick_deployer.py b/src/booking/quick_deployer.py index 2ab18a6..1fd6a9c 100644 --- a/src/booking/quick_deployer.py +++ b/src/booking/quick_deployer.py @@ -269,7 +269,7 @@ def create_from_form(form, request): booking.pdf = PDFTemplater.makePDF(booking) for collaborator in users_field: # list of Users (not UserProfile) - booking.collaborators.add(collaborator.user) + booking.collaborators.add(collaborator) booking.save() diff --git a/src/booking/views.py b/src/booking/views.py index ea038dd..e7ffc42 100644 --- a/src/booking/views.py +++ b/src/booking/views.py @@ -28,6 +28,7 @@ from api.models import JobFactory from workflow.views import login from booking.forms import QuickBookingForm from booking.quick_deployer import create_from_form, drop_filter +import traceback def quick_create_clear_fields(request): @@ -62,6 +63,9 @@ def quick_create(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: + print("Error occurred while handling quick deployment:") + traceback.print_exc() + print(str(e)) messages.error(request, "Whoops, an error occurred: " + str(e)) context.update(drop_filter(request.user)) return render(request, 'booking/quick_deploy.html', context) |