Handle if message is a non-string

This commit is contained in:
Joseph Schorr 2014-01-24 15:24:26 -05:00
parent 3b62d883f4
commit 374754c9c9

View file

@ -11,7 +11,7 @@ DEFAULT_MESSAGE[403] = 'Permission Denied'
DEFAULT_MESSAGE[404] = 'Not Found'
def abort(status_code, message=None, **kwargs):
message = message % kwargs if message else DEFAULT_MESSAGE[status_code]
message = str(message) % kwargs if message else DEFAULT_MESSAGE[status_code]
if status_code == 403:
# Add the user information.