提交 8272e18e 编写于 作者: D Dmitriy Zaporozhets

Project path validation: array of not allowed paths

上级 37e39e41
......@@ -104,8 +104,10 @@ class Project < ActiveRecord::Base
end
def repo_name
if path == "gitolite-admin"
errors.add(:path, " like 'gitolite-admin' is not allowed")
denied_paths = %w(gitolite-admin groups projects dashboard)
if denied_paths.include?(path)
errors.add(:path, "like #{path} is not allowed")
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册