Skip to content

Commit

Permalink
Fixes bug when creating a new incident priority and a color is specif…
Browse files Browse the repository at this point in the history
…ied (#2391)
  • Loading branch information
mvilanova authored Jul 28, 2022
1 parent 85736c2 commit d290523
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dispatch/incident_priority/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ def create(*, db_session, incident_priority_in: IncidentPriorityCreate) -> Incid
db_session=db_session, project_in=incident_priority_in.project
)
incident_priority = IncidentPriority(
**incident_priority_in.dict(exclude={"project"}), project=project
**incident_priority_in.dict(exclude={"project", "color"}), project=project
)
if incident_priority_in.color:
incident_priority.color = incident_priority_in.color.as_hex()

db_session.add(incident_priority)
db_session.commit()
return incident_priority
Expand Down

0 comments on commit d290523

Please sign in to comment.