Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit 7f53e22

Browse files
authored
Allows the reporter/commander to be changed (#1054)
* Allows the reporter/commander to be changed even when no conversation is associated.
1 parent 1a2d498 commit 7f53e22

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/dispatch/incident/flows.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ def create_conversation(incident: Incident, db_session: SessionLocal):
386386

387387
def set_conversation_topic(incident: Incident, db_session: SessionLocal):
388388
"""Sets the conversation topic."""
389+
if not incident.conversation:
390+
log.warning("Conversation topic not sent because incident has no conversation.")
391+
return
392+
389393
conversation_topic = (
390394
f":helmet_with_white_cross: {incident.commander.individual.name}, {incident.commander.team} - "
391395
f"Type: {incident.incident_type.name} - "

src/dispatch/incident/messaging.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,10 @@ def send_incident_new_role_assigned_notification(
587587
notification_text = "Incident Notification"
588588
notification_type = MessageType.incident_notification
589589

590+
if not incident.conversation:
591+
log.warning("Incident new role message not sent because incident has no conversation.")
592+
return
593+
590594
plugin = plugin_service.get_active_instance(
591595
db_session=db_session, project_id=incident.project.id, plugin_type="conversation"
592596
)

src/dispatch/tag/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class TagUpdate(TagBase):
5151
class TagRead(TagBase):
5252
id: int
5353
tag_type: Optional[TagTypeRead]
54+
project: ProjectRead
5455

5556

5657
class TagPagination(DispatchBase):

0 commit comments

Comments
 (0)