From 5768decdbfec50bd397fc9fe428128c8688e888b Mon Sep 17 00:00:00 2001 From: Ildar Iskhakov Date: Thu, 28 Sep 2023 13:54:30 +0800 Subject: [PATCH] Direct paging improvements (hotfix) (#3079) # What this PR does Fixes https://github.com/grafana/oncall/pull/3064 ## Which issue(s) this PR fixes ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --- engine/apps/user_management/models/team.py | 12 ++++++++---- .../ExpandedIntegrationRouteDisplay.tsx | 9 ++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/engine/apps/user_management/models/team.py b/engine/apps/user_management/models/team.py index b45d1db8..bbf329d8 100644 --- a/engine/apps/user_management/models/team.py +++ b/engine/apps/user_management/models/team.py @@ -72,10 +72,14 @@ class TeamManager(models.Manager["Team"]): ) direct_paging_integrations_to_create.append(alert_receive_channel) AlertReceiveChannel.objects.bulk_create(direct_paging_integrations_to_create, batch_size=5000) - created_direct_paging_integrations = AlertReceiveChannel.objects.filter( - organization=organization, - integration=AlertReceiveChannel.INTEGRATION_DIRECT_PAGING, - ).exclude(team__team_id__in=existing_team_ids) + created_direct_paging_integrations = ( + AlertReceiveChannel.objects.filter( + organization=organization, + integration=AlertReceiveChannel.INTEGRATION_DIRECT_PAGING, + ) + .exclude(team__team_id__in=existing_team_ids) + .exclude(team__isnull=True) + ) default_channel_filters_to_create = [] for integration in created_direct_paging_integrations: channel_filter = ChannelFilter( diff --git a/grafana-plugin/src/containers/IntegrationContainers/ExpandedIntegrationRouteDisplay/ExpandedIntegrationRouteDisplay.tsx b/grafana-plugin/src/containers/IntegrationContainers/ExpandedIntegrationRouteDisplay/ExpandedIntegrationRouteDisplay.tsx index cfba65ee..2646c04b 100644 --- a/grafana-plugin/src/containers/IntegrationContainers/ExpandedIntegrationRouteDisplay/ExpandedIntegrationRouteDisplay.tsx +++ b/grafana-plugin/src/containers/IntegrationContainers/ExpandedIntegrationRouteDisplay/ExpandedIntegrationRouteDisplay.tsx @@ -194,8 +194,8 @@ const ExpandedIntegrationRouteDisplay: React.FC - -
+
+ )} -
- - + +
{!isEscalationCollapsed && ( )}