Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-05-20 20:10:28 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2016-05-20 20:20:30 +0300
commitde8c7ed14f6eb93193d73662e2adac6132198bcc (patch)
tree74674c42fbf9e5c1bd00b0a59d9b785ac78c3b78 /app/models/project.rb
parentd53b4d5ba7694114ad76bdf417ffb85860817dd1 (diff)
Merge branch 'fix/url-refactor-from-ee' into 'master'
Update CE code to include some refactor done in EE to do with import url This is simply updating the code to match EE and avoid further conflicts related to `import_data` and `import_url` changes made on EE only. See merge request !4223
Diffstat (limited to 'app/models/project.rb')
-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