url_for, current_app from odesk import Client ODESK_REQUEST_TOKEN = '_ort' ODESK_ACCESS_TOKEN = '_oat' odesk = Module(__name__) def is_authorized(): """ Check authorization for current user """ return session.get(ODESK_ACCESS_TOKEN, False) and True odesk.is_authorized = is_authorized @odesk.app_context_processor def inject_is_authorized(): """ Context processor for is_authorized method """ return {'odesk_is_authorized': is_authorized()} def get_access_token(): """ Get current access token and access token secret """ return session.get(ODESK_ACCESS_TOKEN, [None] * 2)
from odesk import Client ODESK_REQUEST_TOKEN = '_ort' ODESK_ACCESS_TOKEN = '_oat' odesk = Module(__name__) def is_authorized(): """ Check authorization for current user """ return session.get(ODESK_ACCESS_TOKEN, False) and True odesk.is_authorized = is_authorized @odesk.app_context_processor def inject_is_authorized(): """ Context processor for is_authorized method """ return {'odesk_is_authorized': is_authorized()} def get_access_token(): """ Get current access token and access token secret """ return session.get(ODESK_ACCESS_TOKEN, [None] * 2)