summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-05-11 12:09:27 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-12-06 11:08:18 +0100
commit36b1ff47574758048c25de8b6cd4d4be01d90349 (patch)
tree7421002c4001aa537abe485b4c6d2afa719857d9
parent184d165f61da4cdf1626ce05a8ed6b5a0abed09f (diff)
downloadbugzilla-36b1ff47574758048c25de8b6cd4d4be01d90349.tar.gz
bugzilla-36b1ff47574758048c25de8b6cd4d4be01d90349.tar.xz
Flyspray: Only migrate users that are necessary
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-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) = @_;