Skip to content

Commit

Permalink
skip user join on assignment override invisible users query
Browse files Browse the repository at this point in the history
test plan:
* specs

closes #LS-1419

Change-Id: Ie82488b3885f9c8e5f2c029de003398bba574379
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246779
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
  • Loading branch information
maneframe committed Sep 2, 2020
1 parent eabb8c5 commit ee2b75c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/v1/assignment_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def update_assignment_overrides(overrides, overrides_data, updating_user: nil)
def invisible_users_and_overrides_for_user(context, user, existing_overrides)
# get the student overrides the user can't see and ensure those overrides are included
visible_user_ids = context.enrollments_visible_to(user).select(:user_id)
invisible_user_ids = context.users.where.not(id: visible_user_ids).pluck(:id)
invisible_user_ids = context.enrollments.where.not(:user_id => visible_user_ids).distinct.pluck(:user_id)
invisible_override_ids = existing_overrides.select{ |ov|
ov.set_type == 'ADHOC' &&
!ov.visible_student_overrides(visible_user_ids)
Expand Down

0 comments on commit ee2b75c

Please sign in to comment.