Skip to content

Commit

Permalink
Fixing issue with raw signal data (#2817)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss authored Jan 10, 2023
1 parent c87651b commit 0d2873b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/dispatch/signal/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
from dispatch.case import service as case_service
from dispatch.case import flows as case_flows
from dispatch.signal import service as signal_service
from dispatch.signal.models import SignalInstanceCreate
from dispatch.signal.models import SignalInstanceCreate, RawSignal


def create_signal_instance(db_session: SessionLocal, signal_instance_data: dict):
def create_signal_instance(db_session: SessionLocal, signal_instance_data: RawSignal):
"""Creates a signal and a case if necessary."""
signal = signal_service.get_by_variant_or_external_id(
db_session=db_session,
external_id=signal_instance_data.id,
variant=signal_instance_data.variant,
)
signal_instance_in = SignalInstanceCreate(**signal_instance_data, project=signal.project)
signal_instance_in = SignalInstanceCreate(raw=signal_instance_data, project=signal.project)

signal_instance = signal_service.create_instance(
db_session=db_session, signal_instance_in=signal_instance_in
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/signal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class SignalInstanceBase(DispatchBase):
project: ProjectRead
case: Optional[CaseRead]
tags: Optional[List[TagRead]] = []
raw: Any
raw: RawSignal
suppression_rule: Optional[SuppressionRuleBase]
duplication_rule: Optional[DuplicationRuleBase]
created_at: Optional[datetime] = None
Expand Down

0 comments on commit 0d2873b

Please sign in to comment.