修改了gitea中的user_form.rb的认证

This commit is contained in:
sylor_huang@126.com 2020-03-16 19:43:46 +08:00
parent a879069c0a
commit d5069c9254
1 changed files with 7 additions and 7 deletions

View File

@ -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