Commit d6ee0c83 by Oleksandr Barabash

unquote_plus added to handle_mars_report

parent d00fc2a3
......@@ -7,6 +7,7 @@ import traceback
import uuid
from asyncio import Future
from typing import Optional
from urllib import parse
from urllib.parse import urlparse, parse_qsl, urlencode
import aiohttp
......@@ -116,7 +117,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
logger.info("handle_mars_report")
# todo(s1z): Make this secure and not such ugly
stripped_channel_id = channel_id.split(";")[0]
stripped_channel_id = parse.unquote_plus(channel_id).split(";")[0]
reference = await self.cosmos_client.get_conversation(
stripped_channel_id, AppConfig.TENANT_ID
......@@ -141,13 +142,16 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
except Exception:
result = traceback.format_exc()
# send mail notifications!
await turn_context.send_activity(
f"the team aad_object_id: {result}"
)
try:
# send mail notifications!
await turn_context.send_activity(
f"the team aad_object_id: {result}"
)
except Exception:
raise
await self.adapter.continue_conversation(reference, callback,
self.settings.app_id)
return await self.adapter.continue_conversation(reference, callback,
self.settings.app_id)
def send_message(self, pa_message: PAMessage) -> Future[ResourceResponse]:
""" Send message as a bot """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment