code: def get_booking(request):
      
      booking = None
      if request.user.is_authenticated():
          try:
              booking = Booking.objects.get(
                  user=request.user,
                  booking_status__slug='inprogress')
          except Booking.DoesNotExist:
              # The user does not have any open bookings
              pass
      else:
          session = Session.objects.get(
              session_key=request.session.session_key)
          try:
              booking = Booking.objects.get(session=session)
          except Booking.DoesNotExist:
              # The user does not have any bookings in his session
              pass
      return booking
docs: Returns the booking that is in progress for the current user or None
  
      We assume that a user can only have one booking that is in-progress.
  
      TODO: This implementation assumes that there is a status called
      'inprogress' and that there should only be one such booking for a given
      user. We need to see if this can be more generic for future projects.
  
      :param request: The Request object.