Skip to content

Commit

Permalink
Bugfix/task id bytes (#917)
Browse files Browse the repository at this point in the history
* Ensuring we return a string object, not bytes

* encode woes
  • Loading branch information
kevgliss authored Feb 23, 2021
1 parent b843803 commit f0d12b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/dispatch/plugins/dispatch_slack/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@

def base64_decode(input: str):
"""Returns a b64 decoded string."""
return base64.b64decode(input).decode("ascii")

return base64.b64decode(input.encode("ascii")).decode("ascii")

async def handle_slack_action(*, db_session, client, request, background_tasks):
"""Handles slack action message."""
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/plugins/dispatch_slack/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

def base64_encode(input: str):
"""Returns a b64 encoded string."""
return base64.b64encode(input).decode("ascii")
return base64.b64encode(input.encode("ascii")).decode("ascii")


def check_command_restrictions(
Expand Down

0 comments on commit f0d12b7

Please sign in to comment.