BigW Consortium Gitlab

Commit c607b1c9 by James Lopez

fix more specs

parent bef06f8d
...@@ -465,7 +465,7 @@ class Project < ActiveRecord::Base ...@@ -465,7 +465,7 @@ class Project < ActiveRecord::Base
import_url = Gitlab::UrlSanitizer.new(value) import_url = Gitlab::UrlSanitizer.new(value)
super(import_url.sanitized_url) super(import_url.sanitized_url)
create_or_update_import_data(credentials: import_url.credentials) unless errors.messages[:import_url] create_or_update_import_data(credentials: import_url.credentials) if valid_import_url?
end end
def import_url def import_url
...@@ -477,6 +477,10 @@ class Project < ActiveRecord::Base ...@@ -477,6 +477,10 @@ class Project < ActiveRecord::Base
end end
end end
def valid_import_url?
valid? || errors.messages[:import_url].nil?
end
def create_or_update_import_data(data: nil, credentials: nil) def create_or_update_import_data(data: nil, credentials: nil)
project_import_data = import_data || build_import_data project_import_data = import_data || build_import_data
if data if data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment