Commit d6ee0c83 by Oleksandr Barabash

unquote_plus added to handle_mars_report

parent d00fc2a3
...@@ -7,6 +7,7 @@ import traceback ...@@ -7,6 +7,7 @@ import traceback
import uuid import uuid
from asyncio import Future from asyncio import Future
from typing import Optional from typing import Optional
from urllib import parse
from urllib.parse import urlparse, parse_qsl, urlencode from urllib.parse import urlparse, parse_qsl, urlencode
import aiohttp import aiohttp
...@@ -116,7 +117,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler): ...@@ -116,7 +117,7 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
logger.info("handle_mars_report") logger.info("handle_mars_report")
# todo(s1z): Make this secure and not such ugly # 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( reference = await self.cosmos_client.get_conversation(
stripped_channel_id, AppConfig.TENANT_ID stripped_channel_id, AppConfig.TENANT_ID
...@@ -141,13 +142,16 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler): ...@@ -141,13 +142,16 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
except Exception: except Exception:
result = traceback.format_exc() result = traceback.format_exc()
# send mail notifications! try:
await turn_context.send_activity( # send mail notifications!
f"the team aad_object_id: {result}" await turn_context.send_activity(
) f"the team aad_object_id: {result}"
)
except Exception:
raise
await self.adapter.continue_conversation(reference, callback, return await self.adapter.continue_conversation(reference, callback,
self.settings.app_id) self.settings.app_id)
def send_message(self, pa_message: PAMessage) -> Future[ResourceResponse]: def send_message(self, pa_message: PAMessage) -> Future[ResourceResponse]:
""" Send message as a bot """ """ 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