From 9c200b5a15a336e3a3fc8d7ddac53053bc3b6ffe Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Tue, 19 Jan 2021 12:38:32 -0500 Subject: Add booking extension function to admin utils Signed-off-by: Sawyer Bergeron Change-Id: I4efab99e7cb82f69d01de8f74f30047263b4b0c2 Signed-off-by: Sawyer Bergeron --- src/dashboard/admin_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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() -- cgit 1.2.3-korg