-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PART 1] Remove attorney task cancellation hook #14448
[PART 1] Remove attorney task cancellation hook #14448
Conversation
app/controllers/tasks_controller.rb
Outdated
if task.is_a?(AttorneyTask) && update_params[:status].eql?(Constants.TASK_STATUSES.cancelled) | ||
task.verify_user_can_update!(current_user) | ||
|
||
return task.send_back_to_judge_assign! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call send_back_to_judge_assign! directly rather than cancelling the attorney task and relying on the hook to cancel/open tasks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit grumpy at having this in controller. Thinking about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we instead override update_from_params
inside of AttorneyTask, and do this logic there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can! Alec and I were fiddling with where this should go. Didn't want this to have any unintended consequences as we obviously struggled with when it was a cancellation hook.
Code Climate has analyzed commit 26ae658 and detected 0 issues on this pull request. View more on Code Climate. |
@@ -246,7 +246,8 @@ def reassign_attorney_tasks | |||
end | |||
|
|||
def reassign_attorney_task(task) | |||
update_task_status_with_instructions(task, Constants.TASK_STATUSES.cancelled) | |||
task.send_back_to_judge_assign! | |||
task.update_with_instructions(instructions: reassignment_instructions(Constants.TASK_STATUSES.cancelled)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were previously relying on the cancellation hook here. Call the function instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts!
app/controllers/tasks_controller.rb
Outdated
if task.is_a?(AttorneyTask) && update_params[:status].eql?(Constants.TASK_STATUSES.cancelled) | ||
task.verify_user_can_update!(current_user) | ||
|
||
return task.send_back_to_judge_assign! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit grumpy at having this in controller. Thinking about it
app/controllers/tasks_controller.rb
Outdated
if task.is_a?(AttorneyTask) && update_params[:status].eql?(Constants.TASK_STATUSES.cancelled) | ||
task.verify_user_can_update!(current_user) | ||
|
||
return task.send_back_to_judge_assign! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we instead override update_from_params
inside of AttorneyTask, and do this logic there?
Co-authored-by: Kat Tipton <kat@navapbc.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last optional swap. Hurray unhooking stuff! ↪️
* User proper reassign params when reassigning an attorney task * Remove changes * [PART 3] Remove overtime status of appeal if case is reassigned (#14453) * Remove overtime status on judge or attorney reassignment * Wip * Properly set overtime to false when reassigning * Undo changes * lint * Clear suvccess messages
Generated by 🚫 Danger |
FULL STACK
PART 1: Remove attorney task cancellation hook #14448
PART 2: Perform "caseflow" reassign of attorney tasks #14452
PART 3: Remove overtime status of appeal if case is reassigned #14453
THIS PR
Resolves #14181
PART 1 in stack to implement #14366
PART 2 #14452
PART 3 #14453
Description
Calls send_back_to_judge_assign! directly when cancelling an attorney task rather than relying on a callback.
Acceptance Criteria
Testing Plan
User Facing Changes