aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2021-01-19 12:38:32 -0500
committerSawyer Bergeron <sbergeron@iol.unh.edu>2021-01-19 13:15:14 -0500
commit9c200b5a15a336e3a3fc8d7ddac53053bc3b6ffe (patch)
tree98e6acac6bc9aef12e649877939af4206ecae2da /src
parentc77b9169b09b7b53572b45a4f3679e602b8ca6a2 (diff)
Add booking extension function to admin utils
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu> Change-Id: I4efab99e7cb82f69d01de8f74f30047263b4b0c2 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src')
-rw-r--r--src/dashboard/admin_utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dashboard/admin_utils.py b/src/dashboard/admin_utils.py
index 6d990c9..222ccd3 100644
--- a/src/dashboard/admin_utils.py
+++ b/src/dashboard/admin_utils.py
@@ -382,3 +382,9 @@ def add_server(profile, uname, interfaces, lab_username="unh_iol", vendor="unkno
server.interfaces.add(iface)
server.save()
+
+
+def extend_booking(booking_id, days=0, hours=0, minutes=0, weeks=0):
+ booking = Booking.objects.get(id=booking_id)
+ booking.end = booking.end + timedelta(days=days, hours=hours, minutes=minutes, weeks=weeks)
+ booking.save()