summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Troszok <troszok@gmail.com>2012-06-27 00:55:54 +0200
committerJakub Troszok <troszok@gmail.com>2012-06-27 00:55:54 +0200
commit5ab1856291d845b27f68c41f23ca76c78afcbce1 (patch)
tree1e84679f4661e13ce83a63450b9ce7e81b61a383
parent4426bc1844d4f6d1ebc40dcd3babf1d1b167324b (diff)
downloadgitlab-ce-5ab1856291d845b27f68c41f23ca76c78afcbce1.tar.gz
Fixing requests tests.
-rw-r--r--app/models/user.rb2
-rw-r--r--app/views/admin/users/_form.html.haml2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 69750922fa4..02bfabea7f9 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -59,7 +59,7 @@ class User < ActiveRecord::Base
before_validation :generate_password, :on => :create
def generate_password
- if self.force_random_password == true
+ if self.force_random_password
self.password = self.password_confirmation = Devise.friendly_token.first(8)
end
end
diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml
index 1e8a44e406a..bd2e136247a 100644
--- a/app/views/admin/users/_form.html.haml
+++ b/app/views/admin/users/_form.html.haml
@@ -23,7 +23,7 @@
-if f.object.new_record?
.clearfix
= f.label :admin, :class => "checkbox" do
- = f.check_box :force_random_password
+ = f.check_box :force_random_password, {}, true, nil
%span Generate random password
%div.password-fields