Merge pull request 'merge develop to standalone_develop' (#267) from develop into standalone_develop

This commit is contained in:
2021-11-26 14:21:53 +08:00
44 changed files with 735 additions and 604 deletions

View File

@@ -8,4 +8,11 @@ class Organizations::CreateForm < BaseForm
validates :description, length: { maximum: 200 }
validates :name, format: { with: NAME_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
validate do
check_name(name) unless name.blank?
end
def check_name(name)
raise "组织账号已被使用." if Owner.where(login: name.strip).exists?
end
end