Browse Source

fix cla

pull/343/head
chenjing 3 years ago
parent
commit
6b772ea889
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      app/controllers/organizations/clas_controller.rb
  2. +2
    -2
      app/forms/organizations/create_cla_form.rb

+ 1
- 1
app/controllers/organizations/clas_controller.rb View File

@@ -47,7 +47,7 @@ class Organizations::ClasController < Organizations::BaseController

private
def cla_params
params.permit(:name, :key, :content, :organization_id, :pr_need)
params.permit(:name, :key, :content, :pr_need)
end

def load_organization


+ 2
- 2
app/forms/organizations/create_cla_form.rb View File

@@ -1,6 +1,6 @@
class Organizations::CreateClaForm < BaseForm
KEY_REGEX = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]+$/ #只含有数字、字母、下划线不能以下划线开头和结尾
attr_accessor :name, :key, :content, :organization_id, :pr_need
validates :name, :organization_id , :key, presence: true
attr_accessor :name, :key, :content, :pr_need
validates :name , :key, presence: true
validates :key, format: { with: KEY_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
end

Loading…
Cancel
Save