Fix #1406. Validate password only on create
This commit is contained in:
parent
a659cb615a
commit
acbc7df96a
3 changed files with 4 additions and 3 deletions
|
|
@ -53,7 +53,8 @@ class User < ActiveRecord::Base
|
||||||
|
|
||||||
scope :admin, -> { where(is_admin: true) }
|
scope :admin, -> { where(is_admin: true) }
|
||||||
|
|
||||||
validates :email, :password, :password_confirmation, presence: true
|
validates :email, presence: true
|
||||||
|
validates :password, :password_confirmation, presence: true, on: :create
|
||||||
|
|
||||||
validates :username,
|
validates :username,
|
||||||
uniqueness: {
|
uniqueness: {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
Sign In
|
Sign In
|
||||||
.panel-body
|
.panel-body
|
||||||
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
||||||
= f.input :login
|
= f.input :login, label: "Username / Email"
|
||||||
= f.input :password
|
= f.input :password
|
||||||
- if devise_mapping.rememberable?
|
- if devise_mapping.rememberable?
|
||||||
%p.text-right.small
|
%p.text-right.small
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
.control-label
|
.control-label
|
||||||
= "Avatar"
|
= "Avatar"
|
||||||
= image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '')
|
= image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '')
|
||||||
= link_to 'Change your avatar here', 'https://gravatar.com'
|
= link_to 'Change your avatar here', 'https://gravatar.com', target: :_blank
|
||||||
= f.input :affiliation, as: :string,
|
= f.input :affiliation, as: :string,
|
||||||
hint: 'This could be a company, a user group, or nothing at all.'
|
hint: 'This could be a company, a user group, or nothing at all.'
|
||||||
= f.input :biography, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
|
= f.input :biography, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue