def lookup_access_token_for_user(user_obj, token_uuid): try: return OAuthAccessToken.get( OAuthAccessToken.authorized_user == user_obj, OAuthAccessToken.uuid == token_uuid) except OAuthAccessToken.DoesNotExist: return None
def lookup_access_token_by_uuid(token_uuid): try: return OAuthAccessToken.get(OAuthAccessToken.uuid == token_uuid) except OAuthAccessToken.DoesNotExist: return None