Merge pull request #836 from grafana/fix-warning-popup-on-slack-slash-command

Fix warning pop-up on action in slack for disconnected user
This commit is contained in:
Yulya Artyukhina 2022-11-21 11:51:59 +01:00 committed by GitHub
commit 5b62060e41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -270,6 +270,11 @@ class SlackEventApiEndpointView(APIView):
# Open pop-up to inform user why OnCall bot doesn't work if any action was triggered
self._open_warning_window_if_needed(payload, slack_team_identity, warning_text)
return Response(status=200)
elif not slack_user_identity.users.exists():
# Means that slack_user_identity doesn't have any connected user
# Open pop-up to inform user why OnCall bot doesn't work if any action was triggered
self._open_warning_for_unconnected_user(sc, payload)
return Response(status=200)
action_record = SlackActionRecord(user=user, organization=organization, payload=payload)