mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: only validate username when changing it
This commit is contained in:
parent
b3354bdc7b
commit
54f8bdd13b
@ -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…
Reference in New Issue
Block a user