FIX 完善gitea平台修改用户信息接口

This commit is contained in:
Jasder
2020-04-22 15:39:34 +08:00
parent ae2c6627a9
commit e6396bdefd
3 changed files with 66 additions and 7 deletions
+11
View File
@@ -0,0 +1,11 @@
class Gitea::User::UpdateForm
include ActiveModel::Model
EMAIL_REGEX = /^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9_\-.]+(\.[a-zA-Z0-9_-]+)+$/
attr_accessor :username, :email, :admin, :allow_create_organization, :allow_git_hook, :allow_import_local,
:full_name, :location, :login_name, :max_repo_creation, :must_change_password, :password, :prohibit_login,
:source_id, :website
validates :username, presence: true
validates :email, presence: true, format: { with: EMAIL_REGEX, multiline: true }
end