Properly use the auth’ed objects

This commit is contained in:
Joseph Schorr 2014-01-24 15:06:35 -05:00
parent 30a26d099f
commit 77f2706a19

View file

@ -13,9 +13,9 @@ def abort(status_code, message=None, **kwargs):
auth_user = get_authenticated_user()
auth_token = get_validated_token()
if auth_user:
message = message + 'Current user: ' + auth_user
message = message + 'Current user: ' + auth_user.username
elif auth_token:
message = message + 'Current token: ' + auth_token
message = message + 'Current token: ' + auth_token.friendly_name or auth_token.code
message = message % kwargs if message else DEFAULT_MESSAGE[status_code]