Skip to content

Commit 66ea890

Browse files
committed
Fixed failing tests
1 parent 1a82e0c commit 66ea890

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/controllers/api/roles_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ def create_role
137137

138138
def update_role(role)
139139
ApplicationRecord.transaction do
140-
if params[:section_name]
141-
if params[:section_name].empty?
140+
if params.key?(:section_name)
141+
if params[:section_name].blank?
142142
role.section = nil
143143
else
144144
role.section = @current_course.sections.find_by!(name: params[:section_name])
145145
end
146146
end
147-
role.grace_credits = params[:grace_credits] if params[:grace_credits]
148-
role.hidden = params[:hidden].to_s.casecmp('true').zero? if params[:hidden]
147+
role.grace_credits = params[:grace_credits] if params.key?(:grace_credits)
148+
role.hidden = params[:hidden].to_s.casecmp('true').zero? if params.key?(:hidden)
149149
role.save!
150150
end
151151
render 'shared/http_status', locals: { code: '200', message:

app/controllers/graders_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def global_actions
136136
if found_empty_submission
137137
assign_all_graders(filtered_grouping_ids, grader_ids)
138138
flash_now(:info, I18n.t('graders.group_submission_no_files'))
139-
head :ok
140139
else
141140
assign_all_graders(grouping_ids, grader_ids)
142141
end
@@ -192,6 +191,7 @@ def global_actions
192191
rescue StandardError => e
193192
head :bad_request
194193
flash_now(:error, e.message)
194+
return
195195
end
196196
end
197197
when 'criteria_table'

0 commit comments

Comments
 (0)