diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-05-11 12:09:27 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-05-11 12:11:10 +0200 |
commit | 7fc01f1ecf4adfc58d9b452e3bf4e6c8b81946d5 (patch) | |
tree | 6daaffec390ff26d73e01e195fd6773c84ceb630 /Bugzilla/Migrate/Flyspray.pm | |
parent | a11a73b100c0ae5602a0330744d43b2064c2dd09 (diff) | |
download | bugzilla-7fc01f1ecf4adfc58d9b452e3bf4e6c8b81946d5.tar.gz bugzilla-7fc01f1ecf4adfc58d9b452e3bf4e6c8b81946d5.tar.xz |
Flyspray: Only migrate users that are necessary
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'Bugzilla/Migrate/Flyspray.pm')
-rw-r--r-- | Bugzilla/Migrate/Flyspray.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Bugzilla/Migrate/Flyspray.pm b/Bugzilla/Migrate/Flyspray.pm index 3b7d51a1a..faf8fa596 100644 --- a/Bugzilla/Migrate/Flyspray.pm +++ b/Bugzilla/Migrate/Flyspray.pm @@ -485,6 +485,7 @@ sub _read_bugs { 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; } @@ -499,6 +500,13 @@ 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) = @_; |