forked from External/greenlight
Complete refactor of Gemfile and upgraded gems (#2553)
This commit is contained in:
@ -20,7 +20,7 @@ namespace :office365 do
|
||||
old_user.save!
|
||||
else
|
||||
old_main_room = old_user.main_room
|
||||
old_main_room.name = "Old " + old_main_room.name
|
||||
old_main_room.name = "Old #{old_main_room.name}"
|
||||
old_main_room.save!
|
||||
|
||||
new_user.rooms << old_user.rooms
|
||||
|
@ -39,7 +39,7 @@ namespace :room do
|
||||
next if room.uid.split("-").length > 3
|
||||
|
||||
begin
|
||||
new_uid = room.uid + "-" + SecureRandom.alphanumeric(3).downcase
|
||||
new_uid = "#{room.uid}-#{SecureRandom.alphanumeric(3).downcase}"
|
||||
puts "Updating #{room.uid} to #{new_uid}"
|
||||
room.update_attributes(uid: new_uid)
|
||||
rescue => e
|
||||
|
@ -35,7 +35,10 @@ namespace :user do
|
||||
u[:email].prepend "superadmin-" if args[:role] == "super_admin"
|
||||
|
||||
# Create account if it doesn't exist
|
||||
if !User.exists?(email: u[:email], provider: u[:provider])
|
||||
if User.exists?(email: u[:email], provider: u[:provider])
|
||||
puts "Account with that email already exists"
|
||||
puts "Email: #{u[:email]}"
|
||||
else
|
||||
user = User.create(name: u[:name], email: u[:email], password: u[:password],
|
||||
provider: u[:provider], email_verified: true, accepted_terms: true)
|
||||
|
||||
@ -52,9 +55,6 @@ namespace :user do
|
||||
puts "Password: #{u[:password]}"
|
||||
puts "Role: #{u[:role]}"
|
||||
puts "PLEASE CHANGE YOUR PASSWORD IMMEDIATELY" if u[:password] == Rails.configuration.admin_password_default
|
||||
else
|
||||
puts "Account with that email already exists"
|
||||
puts "Email: #{u[:email]}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user