mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-01 09:39:51 -04:00
FIX: only validate username when changing it
This commit is contained in:
parent
b3354bdc7b
commit
54f8bdd13b
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ class User < ActiveRecord::Base
|
|||
before_validation :strip_downcase_email
|
||||
|
||||
validates_presence_of :username
|
||||
validate :username_validator
|
||||
validate :username_validator, if: :username_changed?
|
||||
validates :email, presence: true, uniqueness: true
|
||||
validates :email, email: true, if: :email_changed?
|
||||
validate :password_validator
|
||||
|
|
Loading…
Add table
Reference in a new issue