def get_request_and_user_id():
 from framework.sessions import get_session
 req = get_cache_key()
 user_id = None
 if isinstance(req, FlaskRequest):
  session = get_session()
  user_id = session.data.get('auth_user_id')
 elif hasattr(req, 'user'):
  user_id = getattr(req.user, '_id', None)
 return (req, user_id)

def get_request_and_user_id ( ) : from framework . sessions import get_session req = get_cache_key ( ) user_id = None if isinstance ( req , FlaskRequest ) : session = get_session ( ) user_id = session . data . get ( 'auth_user_id' ) elif hasattr ( req , 'user' ) : user_id = getattr ( req . user , '_id' , None ) return ( req , user_id )
fetch a request and user id from either a django or flask request .