From d5069c9254f8a20fb6a54f65c25b8d69b59b1040 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Mon, 16 Mar 2020 19:43:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86gitea=E4=B8=AD?= =?UTF-8?q?=E7=9A=84user=5Fform.rb=E7=9A=84=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/gitea/user_form.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/forms/gitea/user_form.rb b/app/forms/gitea/user_form.rb index ac943374a..50bbc633f 100644 --- a/app/forms/gitea/user_form.rb +++ b/app/forms/gitea/user_form.rb @@ -5,19 +5,19 @@ class Gitea::UserForm include ActiveModel::Model attr_accessor :username, :email, :password - validates :username, presence: true - validates :email, presence: true, format: { with: EMAIL_REGEX, multiline: true } - - validates :password, presence: true - - validate :check_username, :check_email + # validates :username, presence: true + # validates :email, presence: true, format: { with: EMAIL_REGEX, multiline: true } + # + # validates :password, presence: true + # + # validate :check_username, :check_email attr_reader :record def persist @record = id ? User.find(id) : User.new - if valid? + if true #valid? @record.attributes = attributes.except(:password_confirmation, :id) @record.save! true