Make sure all aborts have message information

This commit is contained in:
Joseph Schorr 2014-02-25 14:15:12 -05:00
parent 1100e72d9e
commit a120f6c64a
3 changed files with 9 additions and 7 deletions

View file

@ -2,7 +2,6 @@ import logging
from app import mixpanel
from flask import request, abort as flask_abort, jsonify
from auth.auth import get_authenticated_user, get_validated_token
logger = logging.getLogger(__name__)
@ -16,6 +15,8 @@ DEFAULT_MESSAGE[409] = 'Conflict'
DEFAULT_MESSAGE[501] = 'Not Implemented'
def abort(status_code, message=None, issue=None, **kwargs):
from auth.auth import get_authenticated_user, get_validated_token
message = (str(message) % kwargs if message else
DEFAULT_MESSAGE.get(status_code, ''))