Fix desktop nil theme bug and approval for new user
This commit is contained in:
parent
fda0abdd25
commit
4b169cf2e0
|
@ -168,7 +168,15 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
|
|||
# }
|
||||
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||
# binding.pry
|
||||
@user.confirmation_token = nil
|
||||
@user.confirmed_at = Time.now
|
||||
@user.approved = true
|
||||
|
||||
if !flash.now[:error] && @user.save
|
||||
desk = @user.desktop
|
||||
desk.theme = DesktopTheme.first.id.to_s
|
||||
desk.wallpaper = nil
|
||||
desk.save!
|
||||
flash[:notice] = t('create.success.user')
|
||||
redirect_to :action => :index
|
||||
else
|
||||
|
|
|
@ -9,6 +9,11 @@ class DesktopController< ApplicationController
|
|||
|
||||
def index
|
||||
@desktop = current_user.desktop
|
||||
if(@desktop.theme.nil?)
|
||||
@desktop.theme = DesktopTheme.first.id.to_s
|
||||
@desktop.wallpaper = nil
|
||||
@desktop.save!
|
||||
end
|
||||
@currentusername = current_user.name
|
||||
@currentname = current_user.first_name + current_user.last_name
|
||||
@title = "Desktop - " + @currentusername
|
||||
|
|
Reference in New Issue