Skip to content

Commit 83927ea

Browse files
committed
fix the kwargs issue on createdefaultrules and improve the action type
1 parent 7659b1a commit 83927ea

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/sentry/workflow_engine/defaults/workflows.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from sentry.models.organization import Organization
66
from sentry.models.project import Project
7+
from sentry.notifications.models.notificationaction import ActionTarget
78
from sentry.notifications.types import FallthroughChoiceType
89
from sentry.workflow_engine.defaults.detectors import _ensure_detector
910
from sentry.workflow_engine.models import (
@@ -84,8 +85,10 @@ def create_priority_workflow(org: Organization) -> Workflow:
8485
action = Action.objects.create(
8586
type=Action.Type.EMAIL,
8687
config={
87-
"target_type": "IssueOwners",
88+
"target_type": ActionTarget.ISSUE_OWNERS,
8889
"target_identifier": None,
90+
},
91+
data={
8992
"fallthrough_type": FallthroughChoiceType.ACTIVE_MEMBERS.value,
9093
},
9194
)

src/sentry/workflow_engine/receivers/project_workflows.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
from typing import Any
23

34
from django.db import router, transaction
45

@@ -35,7 +36,7 @@
3536
PLATFORMS_WITH_PRIORITY_ALERTS = ["python", "javascript"]
3637

3738

38-
def create_default_rules(project: Project) -> None:
39+
def create_default_rules(project: Project, **kwargs: Any) -> None:
3940
rule_data = DEFAULT_RULE_DATA
4041

4142
with transaction.atomic(router.db_for_write(Rule)):

0 commit comments

Comments
 (0)