Skip to content

Commit 46a919e

Browse files
committed
fix: ensure errors on missing streams in user inport is reported correctly
1 parent 908e97d commit 46a919e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/models/unit.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,14 +641,16 @@ def import_users_from_csv(file)
641641
end
642642

643643
# Settings include:
644-
# missing_headers_lambda - lambda to check if row is missing key data
645-
# fetch_row_data_lambda - lambda to convert row from csv to required import data
644+
# missing_headers_lambda - lambda to check if row is missing key data, so that students missing
645+
# any of these header names does not get imported and the missing header
646+
# is reported.
647+
# fetch_row_data_lambda - lambda to convert row from csv to required import data. Called for each
648+
# row that has the required headers.
646649
# replace_existing_tutorial - boolean to indicate if tutorials in csv override ones in doubtfire
647650
# replace_existing_campus - boolean to indicate if campus in csv override ones in doubtfire
648651
import_settings = {
649652
missing_headers_lambda: ->(row) {
650-
missing_headers(row, %w(unit_code username student_id first_name last_name email campus))
651-
missing_headers(row, stream_names)
653+
missing_headers(row, %w(unit_code username student_id first_name last_name email campus) + stream_names)
652654
},
653655
fetch_row_data_lambda: ->(row, unit) {
654656
tutorials = []

0 commit comments

Comments
 (0)