Properly use the auth’ed objects
This commit is contained in:
parent
30a26d099f
commit
77f2706a19
1 changed files with 2 additions and 2 deletions
|
@ -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]
|
||||
|
||||
|
|
Reference in a new issue