Skip to content

Commit

Permalink
fix TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Sep 27, 2023
1 parent 53bc3be commit 78cec14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions routers/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def slack_get_response_for_msg_id(
if not output_text:
return {"status": "no_output"}

content = output_text[0]
if remove_refs:
output_text = "".join(snippet for snippet, _ in parse_refs(output_text, []))

return {"status": "ok", "output_text": output_text}
content = "".join(snippet for snippet, _ in parse_refs(content, []))
return {"status": "ok", "content": content}
2 changes: 1 addition & 1 deletion tests/test_slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ def test_slack_get_response_for_msg_id(transactional_db):
headers={"Authorization": f"Bearer {auth_token}"},
)
assert r.status_code == 200
assert r.json().get("output_text") == ["hello, world!"]
assert r.json().get("content") == "hello, world!"

0 comments on commit 78cec14

Please sign in to comment.