Skip to content

Commit abcbd7e

Browse files
committed
f
1 parent 96eb07f commit abcbd7e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/api/tutorials_api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ class TutorialsApi < Grape::API
110110
end
111111
post '/csv/tutorials/upload' do
112112
unless authorise? current_user, User, :upload_csv
113-
error!({ error: "Not authorised to upload CSV of students of tutorials" }, 403)
113+
error!({ error: 'Not authorised to upload CSV of students of tutorials' }, 403)
114114
end
115115

116116
if params[:file].blank?
117117
error!({ error: 'No file uploaded' }, 403)
118118
end
119119

120120
if params[:file][:tempfile].size > 5.megabytes
121-
error!({ error: "CSV file size exceeds the 5MB limit" }, 413)
121+
error!({ error: 'CSV file size exceeds the 5MB limit' }, 413)
122122
end
123123

124124
path = params[:file][:tempfile].path

app/models/tutorial.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def self.import_from_csv(file)
112112

113113
if unit_role.nil?
114114
errors << { row: row, message: "Tutor with user_id (#{user_id}) not found in unit roles" }
115-
raise StandardError, "Critical import error: missing unit role"
115+
raise StandardError, 'Critical import error: missing unit role'
116116
end
117117

118118
# if tutorial is found set it, otherwise leave it blank
@@ -134,7 +134,7 @@ def self.import_from_csv(file)
134134
success << { row: row, message: "Created tutorial #{abbreviation} #{unit_id}" }
135135
else
136136
errors << { row: row, message: "Failed to create tutorial #{abbreviation} #{unit_id}" }
137-
raise StandardError, "Critical import error: failed to save tutorial"
137+
raise StandardError, 'Critical import error: failed to save tutorial'
138138
end
139139
rescue StandardError => e
140140
raise ActiveRecord::Rollback

0 commit comments

Comments
 (0)