summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2017-04-25 12:43:02 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2017-04-25 14:20:56 -0700
commit877df20c43bbfa7f47b592fd7b28ebc55824dddb (patch)
tree2c847dd51a10335c63f769b80a1e3d49b6394047
parent3c6fad64296738239582ad449bb202cfd99ba7ff (diff)
downloadgitlab-ce-bugfix/ghost-confirmation.tar.gz
skip confirmation for internal usersbugfix/ghost-confirmation
-rw-r--r--app/models/user.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 774d4caa806..3e85b90c815 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -141,6 +141,8 @@ class User < ActiveRecord::Base
after_initialize :set_projects_limit
after_destroy :post_destroy_hook
+ before_validation :skip_internal_confirmation
+
# User's Layout preference
enum layout: [:fixed, :fluid]
@@ -370,6 +372,10 @@ class User < ActiveRecord::Base
where(Hash[internal_attributes.zip([[false, nil]] * internal_attributes.size)])
end
+ def skip_internal_confirmation
+ skip_confirmation! if internal?
+ end
+
#
# Instance methods
#