1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Base64 decoding tweaks

This commit is contained in:
Jeremy Stretch
2017-03-29 13:39:59 -04:00
parent 58e4bf1cc3
commit 6542b8b198
2 changed files with 5 additions and 5 deletions

View File

@@ -184,9 +184,7 @@ class GetSessionKeyViewSet(ViewSet):
key = sk.key
# Encode the key using base64. (b64decode() returns a bytestring under Python 3.)
encoded_key = base64.b64encode(key)
if not isinstance(encoded_key, str):
encoded_key = encoded_key.decode()
encoded_key = base64.b64encode(key).decode()
# Craft the response
response = Response({