Add missing InvalidResponse class.

This commit is contained in:
Jimmy Zelinskie 2014-11-25 16:08:01 -05:00
parent 0e13ef3ff8
commit d9f0d36dfe

View file

@ -53,6 +53,10 @@ class InvalidRequest(ApiException):
def __init__(self, error_description, payload=None): def __init__(self, error_description, payload=None):
ApiException.__init__(self, 'invalid_request', 400, error_description, payload) ApiException.__init__(self, 'invalid_request', 400, error_description, payload)
class InvalidResponse(ApiException):
def __init__(self, error_description, payload=None):
ApiException.__init__(self, 'invalid_response', 400, error_description, payload)
class InvalidToken(ApiException): class InvalidToken(ApiException):
def __init__(self, error_description, payload=None): def __init__(self, error_description, payload=None):
@ -173,7 +177,7 @@ def path_param(name, description):
def add_param(func): def add_param(func):
if not func: if not func:
return func return func
if '__api_path_params' not in dir(func): if '__api_path_params' not in dir(func):
func.__api_path_params = {} func.__api_path_params = {}
func.__api_path_params[name] = { func.__api_path_params[name] = {
@ -293,7 +297,7 @@ def require_fresh_login(func):
if not user.password_hash or last_login >= valid_span: if not user.password_hash or last_login >= valid_span:
return func(*args, **kwargs) return func(*args, **kwargs)
raise FreshLoginRequired() raise FreshLoginRequired()
return wrapped return wrapped