2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
module Gitlab
|
|
|
|
module ImportExport
|
|
|
|
class AvatarSaver
|
|
|
|
def initialize(project:, shared:)
|
|
|
|
@project = project
|
|
|
|
@shared = shared
|
|
|
|
end
|
|
|
|
|
|
|
|
def save
|
|
|
|
return true unless @project.avatar.exists?
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
Gitlab::ImportExport::UploadsManager.new(
|
|
|
|
project: @project,
|
|
|
|
shared: @shared,
|
2018-11-20 20:47:30 +05:30
|
|
|
relative_export_path: 'avatar'
|
2018-11-08 19:23:39 +05:30
|
|
|
).save
|
2016-08-24 12:49:21 +05:30
|
|
|
rescue => e
|
|
|
|
@shared.error(e)
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|