Commit 49f9502d authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-rubocop' into 'master'

Fix ReturnInVoidContext rubocop offense

See merge request gitlab-org/gitlab-ce!24857
parents b9f0eff9 b43ffd0d
...@@ -80,11 +80,6 @@ Lint/InterpolationCheck: ...@@ -80,11 +80,6 @@ Lint/InterpolationCheck:
Lint/MissingCopEnableDirective: Lint/MissingCopEnableDirective:
Enabled: false Enabled: false
# Offense count: 1
Lint/ReturnInVoidContext:
Exclude:
- 'app/models/project.rb'
# Offense count: 9 # Offense count: 9
Lint/UriEscapeUnescape: Lint/UriEscapeUnescape:
Exclude: Exclude:
......
...@@ -738,11 +738,13 @@ class Project < ActiveRecord::Base ...@@ -738,11 +738,13 @@ class Project < ActiveRecord::Base
end end
def import_url=(value) def import_url=(value)
return super(value) unless Gitlab::UrlSanitizer.valid?(value) if Gitlab::UrlSanitizer.valid?(value)
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)
create_or_update_import_data(credentials: import_url.credentials) else
super(value)
end
end end
def import_url def import_url
......
require_relative '../support/helpers/test_env' require_relative '../support/helpers/test_env'
FactoryBot.define do FactoryBot.define do
PAGES_ACCESS_LEVEL_SCHEMA_VERSION = 20180423204600 PAGES_ACCESS_LEVEL_SCHEMA_VERSION ||= 20180423204600
# Project without repository # Project without repository
# #
......
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