1414
1515from django .dispatch import receiver
1616
17- from sentry import options
1817from sentry .constants import ObjectStatus
1918from sentry .hybridcloud .outbox .category import OutboxCategory
2019from sentry .hybridcloud .outbox .signals import process_control_outbox
@@ -65,27 +64,17 @@ def process_sentry_app_deletes(
6564 payload : Mapping [str , Any ],
6665 ** kwds : Any ,
6766):
68- # This function should only be used when the sentry app is being deleted.
69- # Currently this receiver is only used for deletion.
70- if options .get ("workflow_engine.sentry-app-actions-outbox" ):
71- logger .info (
72- "sentry_app_update.update_action_status" ,
73- extra = {
74- "region_name" : region_name ,
75- "sentry_app_id" : object_identifier ,
76- },
77- )
78- action_service .update_action_status_for_sentry_app_via_sentry_app_id (
67+ action_service .update_action_status_for_sentry_app_via_sentry_app_id (
68+ region_name = region_name ,
69+ status = ObjectStatus .DISABLED ,
70+ sentry_app_id = object_identifier ,
71+ )
72+ if slug := payload .get ("slug" ):
73+ action_service .update_action_status_for_webhook_via_sentry_app_slug (
7974 region_name = region_name ,
8075 status = ObjectStatus .DISABLED ,
81- sentry_app_id = object_identifier ,
76+ sentry_app_slug = slug ,
8277 )
83- if slug := payload .get ("slug" ):
84- action_service .update_action_status_for_webhook_via_sentry_app_slug (
85- region_name = region_name ,
86- status = ObjectStatus .DISABLED ,
87- sentry_app_slug = slug ,
88- )
8978
9079
9180@receiver (process_control_outbox , sender = OutboxCategory .SENTRY_APP_INSTALLATION_DELETE )
@@ -96,21 +85,11 @@ def process_sentry_app_installation_deletes(
9685 payload : Mapping [str , Any ],
9786 ** kwds : Any ,
9887):
99- # This function should only be used when the sentry app is being deleted.
100- # Currently this receiver is only used for deletion.
101- if options .get ("workflow_engine.sentry-app-actions-outbox" ):
102- logger .info (
103- "sentry_app_installation_delete.update_action_status" ,
104- extra = {
105- "region_name" : region_name ,
106- "sentry_app_install_uuid" : payload ["uuid" ],
107- },
108- )
109- action_service .update_action_status_for_sentry_app_via_uuid__region (
110- region_name = region_name ,
111- status = ObjectStatus .DISABLED ,
112- sentry_app_install_uuid = payload ["uuid" ],
113- )
88+ action_service .update_action_status_for_sentry_app_via_uuid__region (
89+ region_name = region_name ,
90+ status = ObjectStatus .DISABLED ,
91+ sentry_app_install_uuid = payload ["uuid" ],
92+ )
11493
11594
11695@receiver (process_control_outbox , sender = OutboxCategory .API_APPLICATION_UPDATE )
0 commit comments