summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-05-20 14:55:27 +0200
committerJames Lopez <james@jameslopez.es>2016-05-20 14:55:27 +0200
commit341c1181d9bb2079c27a6da5b13f9299c7be0952 (patch)
tree03109b62e0395541df530863580f785ef2d573c9
parentf26389a02a48a53cccb3bb7dd1d7bcd4858c118d (diff)
downloadgitlab-ce-fix/url-refactor-from-ee.tar.gz
refactor project to include some nicer EE stufffix/url-refactor-from-ee
-rw-r--r--app/models/project.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 9a34198e098..37de1dfe4d5 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -204,7 +204,7 @@ class Project < ActiveRecord::Base
state :finished
state :failed
- after_transition any => :finished, do: :clear_import_data
+ after_transition any => :finished, do: :reset_cache_and_import_attrs
end
class << self
@@ -360,7 +360,7 @@ class Project < ActiveRecord::Base
end
end
- def clear_import_data
+ def reset_cache_and_import_attrs
update(import_error: nil)
ProjectCacheWorker.perform_async(self.id)
@@ -426,12 +426,7 @@ class Project < ActiveRecord::Base
end
def safe_import_url
- result = URI.parse(self.import_url)
- result.password = '*****' unless result.password.nil?
- result.user = '*****' unless result.user.nil? || result.user == "git" #tokens or other data may be saved as user
- result.to_s
- rescue
- self.import_url
+ Gitlab::UrlSanitizer.new(import_url).masked_url
end
def check_limit