diff options
Diffstat (limited to 'src/dashboard/admin_utils.py')
-rw-r--r-- | src/dashboard/admin_utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dashboard/admin_utils.py b/src/dashboard/admin_utils.py index 050f246..367c613 100644 --- a/src/dashboard/admin_utils.py +++ b/src/dashboard/admin_utils.py @@ -58,11 +58,15 @@ def book_host(owner_username, host_labid, lab_username, hostname, image_id, temp host.bundle = resource_bundle host.config = config rmanager.configureNetworking(resource_bundle, host, vlan_map) + host.save() except Exception: host.booked = False + host.save() print("Failed to book host due to error configuring it") return + new_template.save() + booking = Booking.objects.create( purpose=purpose, project=project, @@ -76,6 +80,8 @@ def book_host(owner_username, host_labid, lab_username, hostname, image_id, temp booking.pdf = PDFTemplater.makePDF(booking) + booking.save() + for collaborator_username in collaborator_usernames: try: user = User.objects.get(username=collaborator_username) |