Skip to content

Commit

Permalink
code climate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amulyausem committed Dec 4, 2023
1 parent 64b210d commit e95656f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/controllers/grading_histories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def action_allowed?
# admins and superadmins are always allowed
return true if current_user_has_admin_privileges?
# populate assignment fields
assignment_for_history(params[:grade_type])
populate_assignment_fields
# if not admin/superadmin, check permissions
if @assignment.instructor_id == current_user.id
true
Expand All @@ -19,6 +19,11 @@ def action_allowed?
end
end

private
def populate_assignment_fields
assignment_for_history(params[:grade_type])
end

# populate the assignment fields according to type
def assignment_for_history(type)
# for a submission, the receiver is an AssignmentTeam
Expand Down

0 comments on commit e95656f

Please sign in to comment.