diff options
author | James Lopez <james@jameslopez.es> | 2016-06-13 17:09:21 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-06-13 17:09:21 +0200 |
commit | 9fd35740b8e4b9b32fe86c438edb7e367d5f4850 (patch) | |
tree | 8a192628e0347ea4273aead841e89b12e9a57b73 | |
parent | 833dc3204d9573dfb1a8f0a433f21a0ff709969c (diff) | |
download | gitlab-ce-9fd35740b8e4b9b32fe86c438edb7e367d5f4850.tar.gz |
refactored notes logic
-rw-r--r-- | lib/gitlab/import_export/relation_factory.rb | 8 |
1 files 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) |