summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Migrate/Flyspray.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/Bugzilla/Migrate/Flyspray.pm b/Bugzilla/Migrate/Flyspray.pm
index 406bb8f66..c38c21a35 100644
--- a/Bugzilla/Migrate/Flyspray.pm
+++ b/Bugzilla/Migrate/Flyspray.pm
@@ -529,6 +529,7 @@ sub _get_username {
my ($self, $userid) = @_;
my $email = $self->{map_user_id_to_email}->{$userid // -1}
// $self->{map_user_id_to_email}->{-1};
+ $self->{email_to_keep}->{$email} = 1;
return $email;
}
@@ -543,6 +544,14 @@ sub translate_bug {
return wantarray ? ($bug, $other_fields) : $bug;
}
+sub after_read {
+ my ($self) = @_;
+
+ # only migrate users that have comments/attachments/are used somewhere
+ $self->{users} = [grep { defined $self->{email_to_keep}->{$_->{login_name}} }
+ @{$self->{users}}];
+}
+
sub after_insert {
my ($self) = @_;