Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/dispatch/incident/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,13 +1133,14 @@ def incident_assign_role_flow(
"weblink": None,
}

if incident.status != IncidentStatus.closed:
if incident.status != IncidentStatus.closed.value:
# we send a notification to the incident conversation
send_incident_new_role_assigned_notification(
assigner_contact_info, assignee_contact_info, assignee_role, incident, db_session
)

if assignee_role == ParticipantRoleType.incident_commander:

if assignee_role == ParticipantRoleType.incident_commander.value:
# we send a message to the incident commander with tips on how to manage the incident
send_incident_management_help_tips_message(incident, db_session)

Expand Down
4 changes: 3 additions & 1 deletion src/dispatch/incident/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@ def send_incident_new_role_assigned_notification(
db_session=db_session, project_id=incident.project.id, plugin_type="conversation"
)
if not plugin:
log.warning("Incident new role message not sent because no conversation plugin is enabled.")
log.warning(
"Incident new role assignment message not sent. No conversation plugin is enabled."
)
return

plugin.instance.send(
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/incident/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def assign_incident_role(
incident_description=incident.description,
)

elif role == ParticipantRoleType.liaison:
elif role == ParticipantRoleType.liaison.value:
if incident.incident_type.liaison_service:
service = incident.incident_type.liaison_service
if oncall_plugin:
Expand Down
8 changes: 4 additions & 4 deletions src/dispatch/incident/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ def create_incident(
db_session=db_session, reporter_email=current_user.email, **incident_in.dict()
)

if incident.status == IncidentStatus.stable:
if incident.status == IncidentStatus.stable.value:
background_tasks.add_task(incident_create_stable_flow, incident_id=incident.id)
elif incident.status == IncidentStatus.closed:
elif incident.status == IncidentStatus.closed.value:
background_tasks.add_task(incident_create_closed_flow, incident_id=incident.id)
else:
background_tasks.add_task(incident_create_flow, incident_id=incident.id)
Expand Down Expand Up @@ -151,7 +151,7 @@ def update_incident(
current_user.email,
incident_id=incident.id,
assignee_email=incident_in.commander.individual.email,
assignee_role=ParticipantRoleType.incident_commander,
assignee_role=ParticipantRoleType.incident_commander.value,
)

# assign reporter
Expand All @@ -160,7 +160,7 @@ def update_incident(
current_user.email,
incident_id=incident.id,
assignee_email=incident_in.reporter.individual.email,
assignee_role=ParticipantRoleType.reporter,
assignee_role=ParticipantRoleType.reporter.value,
)

return incident
Expand Down
4 changes: 2 additions & 2 deletions src/dispatch/participant_role/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def assign_role_flow(
add_role(
db_session=db_session,
participant_id=participant_with_assignee_role.id,
participant_role=ParticipantRoleType.participant,
participant_role=ParticipantRoleType.participant.value,
)

log.debug(
Expand All @@ -68,7 +68,7 @@ def assign_role_flow(
db_session=db_session, participant_id=assignee_participant.id
)
for participant_active_role in participant_active_roles:
if participant_active_role.role == ParticipantRoleType.participant:
if participant_active_role.role == ParticipantRoleType.participant.value:
renounce_role(db_session=db_session, participant_role=participant_active_role)
break

Expand Down