aboutsummaryrefslogtreecommitdiffstats
path: root/src/dashboard/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/dashboard/views.py')
-rw-r--r--src/dashboard/views.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/dashboard/views.py b/src/dashboard/views.py
index 2ace2d4..f9a908c 100644
--- a/src/dashboard/views.py
+++ b/src/dashboard/views.py
@@ -12,8 +12,12 @@
from django.shortcuts import get_object_or_404
from django.views.generic import TemplateView
from django.shortcuts import render
+from django.db.models import Q
+from datetime import datetime
+import pytz
from account.models import Lab
+from booking.models import Booking
from resource_inventory.models import Image, ResourceProfile, ResourceQuery
from workflow.workflow_manager import ManagerTracker
@@ -65,12 +69,22 @@ def host_profile_detail_view(request):
def landing_view(request):
manager = ManagerTracker.managers.get(request.session.get('manager_session'))
+ user = request.user
+ if not user.is_anonymous:
+ bookings = Booking.objects.filter(
+ Q(owner=user) | Q(collaborators=user),
+ end__gte=datetime.now(pytz.utc)
+ )
+ else:
+ bookings = None
+
return render(
request,
'dashboard/landing.html',
{
'manager': manager is not None,
- 'title': "Welcome to the Lab as a Service Dashboard"
+ 'title': "Welcome to the Lab as a Service Dashboard",
+ 'bookings': bookings
}
)