Skip to content

Commit

Permalink
refactore code
Browse files Browse the repository at this point in the history
  • Loading branch information
devketanpro committed Dec 9, 2024
1 parent e7ed3bb commit 6338d80
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/features/planning.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ Feature: Planning
"slugline": "test slugline"
},
"assigned_to": {
"desk": "Politic Desk",
"desk": "Sports Desk",
"user": "507f191e810c19729de870eb",
"assignment_id": "#firstassignment#",
"state": "assigned"
Expand Down
1 change: 1 addition & 0 deletions server/planning/events/events_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
"priority": {"type": "integer", "nullable": True},
"coverage_provider": {
"type": "dict",
"nullable": True,
"schema": {
"qcode": {"type": "string"},
"name": {"type": "string"},
Expand Down
3 changes: 2 additions & 1 deletion server/planning/planning/planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,9 +1012,10 @@ def _create_update_assignment(
assignment["name"] = planning["name"] if not translated_value and translated_name else translated_name

# If the coverage assignee has been changed and workflow status is active
if updates.get("workflow_status") == WORKFLOW_STATE.ACTIVE and self.is_coverage_assignment_modified(
if original.get("workflow_status") == WORKFLOW_STATE.ACTIVE and self.is_coverage_assignment_modified(
updates, original_assignment
):
assigned_to["state"] = ASSIGNMENT_WORKFLOW_STATE.ASSIGNED
assignment["assigned_to"] = assigned_to

# If there has been a change in the planning internal note then notify the assigned users/desk
Expand Down

0 comments on commit 6338d80

Please sign in to comment.