diff --git a/src/dispatch/case/flows.py b/src/dispatch/case/flows.py index 86b04e400096..12a8ac4f32e1 100644 --- a/src/dispatch/case/flows.py +++ b/src/dispatch/case/flows.py @@ -202,6 +202,9 @@ def case_new_create_flow( create_all_resources=create_all_resources, ) + db_session.add(case) + db_session.commit() + if case.case_priority.page_assignee: if not service_id: if case.case_type.oncall_service: @@ -210,22 +213,21 @@ def case_new_create_flow( log.warning( "Case assignee not paged. No relationship between case type and an oncall service." ) - else: - oncall_plugin = plugin_service.get_active_instance( - db_session=db_session, project_id=case.project.id, plugin_type="oncall" - ) - if oncall_plugin: - oncall_plugin.instance.page( - service_id=service_id, - incident_name=case.name, - incident_title=case.title, - incident_description=case.description, - ) - else: - log.warning("Case assignee not paged. No plugin of type oncall enabled.") + return case - db_session.add(case) - db_session.commit() + oncall_plugin = plugin_service.get_active_instance( + db_session=db_session, project_id=case.project.id, plugin_type="oncall" + ) + if oncall_plugin: + oncall_plugin.instance.page( + service_id=service_id, + incident_name=case.name, + incident_title=case.title, + incident_description=case.description, + ) + else: + log.warning("Case assignee not paged. No plugin of type oncall enabled.") + return case return case diff --git a/src/dispatch/signal/models.py b/src/dispatch/signal/models.py index c50857c221ca..44abea4bb536 100644 --- a/src/dispatch/signal/models.py +++ b/src/dispatch/signal/models.py @@ -240,13 +240,13 @@ class SignalInstance(Base, TimeStampMixin, ProjectMixin): signal_name = column_property(select([Signal.name]).where(Signal.id == signal_id)) signal_description = column_property(select([Signal.description]).where(Signal.id == signal_id)) - search_vector = Column( - TSVectorType( - "signal_name", - "signal_description", - weights={"signal_name": "A", "signal_description": "B"}, - ) - ) + # search_vector = Column( + # TSVectorType( + # "signal_name", + # "signal_description", + # weights={"signal_name": "A", "signal_description": "B"}, + # ) + # ) # Pydantic models