From 9fd35740b8e4b9b32fe86c438edb7e367d5f4850 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Mon, 13 Jun 2016 17:09:21 +0200 Subject: [PATCH] refactored notes logic --- lib/gitlab/import_export/relation_factory.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb index df05d6a6f67..5f12caa8981 100644 --- a/lib/gitlab/import_export/relation_factory.rb +++ b/lib/gitlab/import_export/relation_factory.rb @@ -57,9 +57,11 @@ module Gitlab author = @relation_hash.delete('author') - if admin_user? && @members_mapper.missing_author_ids.include?(old_author_id) - update_note_for_missing_author(author['name']) - end + update_note_for_missing_author(author['name']) if can_update_notes? + end + + def can_update_notes? + (admin_user? && @members_mapper.missing_author_ids.include?(old_author_id)) || !admin_user? end def missing_author_note(updated_at, author_name) -- GitLab