mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-08 16:06:03 +08:00
Merge pull request #590 from okriuchykhin/ok_SCI_1229
Fix importing users from file [SCI-1229]
This commit is contained in:
commit
05d2d4380e
1 changed files with 3 additions and 3 deletions
|
@ -40,7 +40,7 @@ namespace :db do
|
||||||
password = generate_user_password if password.blank?
|
password = generate_user_password if password.blank?
|
||||||
|
|
||||||
user_teams = user_hash['teams']
|
user_teams = user_hash['teams']
|
||||||
user_teams = '' if user_teams.blank
|
user_teams = '' if user_teams.blank?
|
||||||
|
|
||||||
team_ids =
|
team_ids =
|
||||||
user_teams
|
user_teams
|
||||||
|
@ -55,7 +55,7 @@ namespace :db do
|
||||||
user_hash['email'],
|
user_hash['email'],
|
||||||
password,
|
password,
|
||||||
true,
|
true,
|
||||||
create_teams ? Constants::DEFAULT_PRIVATE_ORG_NAME : nil,
|
create_teams ? Constants::DEFAULT_PRIVATE_TEAM_NAME : nil,
|
||||||
team_ids
|
team_ids
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ namespace :db do
|
||||||
team_ids = []
|
team_ids = []
|
||||||
team_names.each do |team_name|
|
team_names.each do |team_name|
|
||||||
team = Team.order(created_at: :desc).where(name: team_name).first
|
team = Team.order(created_at: :desc).where(name: team_name).first
|
||||||
team = Team.create(name: team_name[0..99]) if team.blank
|
team = Team.create(name: team_name[0..99]) if team.blank?
|
||||||
|
|
||||||
team_ids << team.id
|
team_ids << team.id
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue