Skip to content

Commit

Permalink
Merge branch 'master' into upgrade-vuetify
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss authored Oct 27, 2023
2 parents 650f79d + a08e999 commit 1f83546
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
32 changes: 17 additions & 15 deletions src/dispatch/case/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
14 changes: 1 addition & 13 deletions src/dispatch/signal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from pydantic import Field
from sqlalchemy import (
select,
Boolean,
Column,
DateTime,
Expand All @@ -17,7 +16,7 @@
UniqueConstraint,
)
from sqlalchemy.dialects.postgresql import JSONB, UUID
from sqlalchemy.orm import relationship, column_property
from sqlalchemy.orm import relationship
from sqlalchemy_utils import TSVectorType

from dispatch.auth.models import DispatchUser
Expand Down Expand Up @@ -237,17 +236,6 @@ class SignalInstance(Base, TimeStampMixin, ProjectMixin):
signal = relationship("Signal", backref="instances")
signal_id = Column(Integer, ForeignKey("signal.id"))

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"},
)
)


# Pydantic models
class Service(DispatchBase):
Expand Down

0 comments on commit 1f83546

Please sign in to comment.