mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:33:05 +08:00
Merge pull request '同步到测试环境' (#294) from develop into standalone_develop
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class Organizations::CreateForm < BaseForm
|
||||
NAME_REGEX = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]+$/ #只含有数字、字母、下划线不能以下划线开头和结尾
|
||||
attr_accessor :name, :description, :website, :location, :repo_admin_change_team_access, :visibility, :max_repo_creation, :nickname
|
||||
attr_accessor :name, :description, :website, :location, :repo_admin_change_team_access, :visibility, :max_repo_creation, :nickname, :original_name
|
||||
|
||||
validates :name, :nickname, :visibility, presence: true
|
||||
validates :name, :nickname, length: { maximum: 100 }
|
||||
@@ -9,7 +9,7 @@ class Organizations::CreateForm < BaseForm
|
||||
validates :name, format: { with: NAME_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
|
||||
|
||||
validate do
|
||||
check_name(name) unless name.blank?
|
||||
check_name(name) unless name.blank? || name == original_name
|
||||
end
|
||||
|
||||
def check_name(name)
|
||||
|
||||
@@ -4,5 +4,5 @@ class Users::LoginForm
|
||||
attr_accessor :password, :login
|
||||
|
||||
validates :login, presence: true
|
||||
validates :password, presence: true, length: { minimum: 8, maximum: 16 }, format: { with: CustomRegexp::PASSWORD, message: "8~16位,支持字母数字和符号" }
|
||||
validates :password, presence: true, length: { minimum: 6, maximum: 16 }, format: { with: CustomRegexp::PASSWORD, message: "6~16位,支持字母数字和符号" }
|
||||
end
|
||||
Reference in New Issue
Block a user