|
@@ -388,7 +388,8 @@ class SlackActionEndpoint(Endpoint):
|
|
# but seems like there's no other solutions [1]:
|
|
# but seems like there's no other solutions [1]:
|
|
#
|
|
#
|
|
# [1]: https://stackoverflow.com/questions/46629852/update-a-bot-message-after-responding-to-a-slack-dialog#comment80795670_46629852
|
|
# [1]: https://stackoverflow.com/questions/46629852/update-a-bot-message-after-responding-to-a-slack-dialog#comment80795670_46629852
|
|
- use_block_kit = features.has("organizations:slack-block-kit", group.project.organization)
|
|
|
|
|
|
+ org = group.project.organization
|
|
|
|
+ use_block_kit = features.has("organizations:slack-block-kit", org)
|
|
callback_id = {
|
|
callback_id = {
|
|
"issue": group.id,
|
|
"issue": group.id,
|
|
"orig_response_url": slack_request.data["response_url"],
|
|
"orig_response_url": slack_request.data["response_url"],
|
|
@@ -423,13 +424,27 @@ class SlackActionEndpoint(Endpoint):
|
|
headers = {"content-type": "application/json; charset=utf-8"}
|
|
headers = {"content-type": "application/json; charset=utf-8"}
|
|
slack_client.post("/views.open", data=json.dumps(payload), headers=headers)
|
|
slack_client.post("/views.open", data=json.dumps(payload), headers=headers)
|
|
except ApiError as e:
|
|
except ApiError as e:
|
|
- logger.exception("slack.action.response-error", extra={"error": str(e)})
|
|
|
|
|
|
+ logger.exception(
|
|
|
|
+ "slack.action.response-error",
|
|
|
|
+ extra={
|
|
|
|
+ "error": str(e),
|
|
|
|
+ "organization_id": org.id,
|
|
|
|
+ "integration_id": slack_request.integration.id,
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
|
|
else:
|
|
else:
|
|
try:
|
|
try:
|
|
slack_client.post("/dialog.open", data=payload)
|
|
slack_client.post("/dialog.open", data=payload)
|
|
except ApiError as e:
|
|
except ApiError as e:
|
|
- logger.exception("slack.action.response-error", extra={"error": str(e)})
|
|
|
|
|
|
+ logger.exception(
|
|
|
|
+ "slack.action.response-error",
|
|
|
|
+ extra={
|
|
|
|
+ "error": str(e),
|
|
|
|
+ "organization_id": org.id,
|
|
|
|
+ "integration_id": slack_request.integration.id,
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
|
|
def open_archive_dialog(self, slack_request: SlackActionRequest, group: Group) -> None:
|
|
def open_archive_dialog(self, slack_request: SlackActionRequest, group: Group) -> None:
|
|
callback_id = {
|
|
callback_id = {
|
|
@@ -781,9 +796,13 @@ class SlackActionEndpoint(Endpoint):
|
|
if org_context:
|
|
if org_context:
|
|
use_block_kit = any(
|
|
use_block_kit = any(
|
|
[
|
|
[
|
|
- True
|
|
|
|
- if features.has("organizations:slack-block-kit", org_context.organization)
|
|
|
|
- else False
|
|
|
|
|
|
+ (
|
|
|
|
+ True
|
|
|
|
+ if features.has(
|
|
|
|
+ "organizations:slack-block-kit", org_context.organization
|
|
|
|
+ )
|
|
|
|
+ else False
|
|
|
|
+ )
|
|
for oi in org_integrations
|
|
for oi in org_integrations
|
|
]
|
|
]
|
|
)
|
|
)
|