def user_id_from_request(request):
    """ Given a request object, return the UUID for the logged in user.
        Returns None if the user is not logged in. """
    sess = request.environ.get('beaker.session')
    return sess.get('user_id', None)