summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-11 16:23:51 +0100
committerDouwe Maan <douwe@gitlab.com>2015-11-18 12:00:56 +0100
commit40470975e863b271f09fe147eb2eb545211e1b08 (patch)
tree31132260a89b6a5a8752496b51ff87a9a9a7e1bb /app/models
parent841a7c6897b23957286056498cc3f05ec4330d15 (diff)
downloadgitlab-ce-40470975e863b271f09fe147eb2eb545211e1b08.tar.gz
Add Project#safe_import_url helper.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index c2ff103759a..70a648e68a3 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -348,6 +348,14 @@ class Project < ActiveRecord::Base
import_status == 'finished'
end
+ def safe_import_url
+ result = URI.parse(self.import_url)
+ result.password = '*****' unless result.password.nil?
+ result.to_s
+ rescue
+ original_url
+ end
+
def check_limit
unless creator.can_create_project? or namespace.kind == 'group'
errors[:limit_reached] << ("Your project limit is #{creator.projects_limit} projects! Please contact your administrator to increase it")