Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1331 from YaleSTC/1272_import_users_table_bug
Browse files Browse the repository at this point in the history
Bug with imported users table
  • Loading branch information
orenyk committed Oct 30, 2015
2 parents 019efac + 4c65f06 commit 39f84a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/csv_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ def import_with_ldap(user_data)
# tries to save using only the csv data. This method will return
# false if the data specified in the csv is invalid on the user model.
def attempt_save_with_csv_data?(user_data)
# use username if using cas, email otherwise
user_data[:username] = user_data[ENV['CAS_AUTH'] ? :username : :email]
if ENV['CAS_AUTH']
# set the cas login
user_data[:cas_login] = user_data[:username]
else
# set the username
user_data[:username] = user_data[:email]
end

user = set_or_create_user_for_import(user_data)

Expand Down

0 comments on commit 39f84a5

Please sign in to comment.