summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-06-30 13:17:37 +0200
committerJames Lopez <james@jameslopez.es>2016-06-30 13:17:37 +0200
commit5b893d603dd68f263129523f13e8eb68b67fe790 (patch)
treef17be7ff52f89672f6895c45d0c15e687e50527a /app/models/project.rb
parent0ca275748314a27a1f36e12fe1360df11c9be25d (diff)
downloadgitlab-ce-5b893d603dd68f263129523f13e8eb68b67fe790.tar.gz
few changes based on feedback
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 2b1b25ab9d2..89ce61b95ec 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -445,11 +445,11 @@ class Project < ActiveRecord::Base
end
def import_url=(value)
+ return super(value) unless Gitlab::UrlSanitizer.valid?(value)
+
import_url = Gitlab::UrlSanitizer.new(value)
create_or_update_import_data(credentials: import_url.credentials)
super(import_url.sanitized_url)
- rescue Addressable::URI::InvalidURIError
- errors.add(:import_url, 'must be a valid URL.')
end
def import_url