Merge pull request #3143 from Undev/state-machine-3

State machine 3
This commit is contained in:
Dmitriy Zaporozhets 2013-03-05 05:38:16 -08:00
commit f22488f726
15 changed files with 68 additions and 33 deletions

View file

@ -2,11 +2,11 @@ module Gitlab
module Entities
class User < Grape::Entity
expose :id, :username, :email, :name, :bio, :skype, :linkedin, :twitter,
:dark_scheme, :theme_id, :blocked, :created_at, :extern_uid, :provider
:dark_scheme, :theme_id, :state, :created_at, :extern_uid, :provider
end
class UserBasic < Grape::Entity
expose :id, :username, :email, :name, :blocked, :created_at
expose :id, :username, :email, :name, :state, :created_at
end
class UserLogin < UserBasic

View file

@ -41,10 +41,12 @@ module Gitlab
password_confirmation: password,
projects_limit: Gitlab.config.gitlab.default_projects_limit,
}, as: :admin)
if Gitlab.config.omniauth['block_auto_created_users'] && !ldap
@user.blocked = true
end
@user.save!
if Gitlab.config.omniauth['block_auto_created_users'] && !ldap
@user.block
end
@user
end