Skip to content

Commit

Permalink
Don't b64encode upload token
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-duhnea committed Jan 9, 2018
1 parent f4c0e5d commit 7b53939
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions reportek/core/api/views.py
Expand Up @@ -314,11 +314,15 @@ def create(self, request, envelope_pk):
)

token = envelope.upload_tokens.create(user=request.user)
return Response(
{
'token': b64encode(token.token.encode())
response = {
'token': token.token
}
)

# Include base64 encoded token in development environments
if settings.DEBUG:
response['token_base64'] = b64encode(token.token.encode())

return Response(response)

def list(self, request, envelope_pk):
"""
Expand Down

0 comments on commit 7b53939

Please sign in to comment.