Commit dd639550 authored by James Lopez's avatar James Lopez

updated create_or_update_import_data to use guard clause

parent 0b2469a4
......@@ -465,7 +465,7 @@ class Project < ActiveRecord::Base
import_url = Gitlab::UrlSanitizer.new(value)
super(import_url.sanitized_url)
create_or_update_import_data(credentials: import_url.credentials) if valid_import_url?
create_or_update_import_data(credentials: import_url.credentials)
end
def import_url
......@@ -482,6 +482,8 @@ class Project < ActiveRecord::Base
end
def create_or_update_import_data(data: nil, credentials: nil)
return unless valid_import_url?
project_import_data = import_data || build_import_data
if data
project_import_data.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