diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-06-11 16:29:37 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-11 16:29:37 +0300 |
commit | 1418afc2d6e7699f08a1fc5f33b78ea847ac1451 (patch) | |
tree | 7f1cd2621237c4dd234651bd16d6e304989b731d /app/models/project.rb | |
parent | 180dc237152d60d05e4f75d8c936e81ba783b6cd (diff) |
Avoid checking the user format in every url validation
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 60cd13b371f..9ca733ecd98 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -292,6 +292,7 @@ class Project < ActiveRecord::Base validates :name, uniqueness: { scope: :namespace_id } validates :import_url, url: { protocols: %w(http https ssh git), allow_localhost: false, + enforce_user: true, ports: VALID_IMPORT_PORTS }, if: [:external_import?, :import_url_changed?] validates :star_count, numericality: { greater_than_or_equal_to: 0 } validate :check_limit, on: :create |