Skip to content

Commit

Permalink
Ensure adding project when creating feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 committed Oct 18, 2024
1 parent 0d4fe49 commit 32d134f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dispatch/feedback/incident/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ def create(*, db_session, feedback_in: FeedbackCreate) -> Feedback:
db_session=db_session,
incident_id=feedback_in.incident.id,
)
project = incident.project
case = None
else:
case = case_service.get(
db_session=db_session,
case_id=feedback_in.case.id,
)
project = case.project
incident = None
feedback = Feedback(
**feedback_in.dict(exclude={"incident", "case"}),
**feedback_in.dict(exclude={"incident", "case", "project"}),
incident=incident,
case=case,
project=project,
)
db_session.add(feedback)
db_session.commit()
Expand Down

0 comments on commit 32d134f

Please sign in to comment.