View | Details | Raw Unified | Return to bug 41238
Collapse All | Expand All

(-)a/Koha/BackgroundJob/PseudonymizeStatistic.pm (+2 lines)
Lines 53-58 sub process { Link Here
53
    my $statistic   = $args->{statistic};
53
    my $statistic   = $args->{statistic};
54
    my $stat_object = Koha::Statistic->new($statistic);
54
    my $stat_object = Koha::Statistic->new($statistic);
55
    Koha::PseudonymizedTransaction->create_from_statistic($stat_object);
55
    Koha::PseudonymizedTransaction->create_from_statistic($stat_object);
56
    $self->progress(1)
57
        ;    #We could use step here, but we are going to save the object during finish and this saves a DB write
56
    $self->finish( { data => "" } );    # We want to clear the job data to avoid storing patron information
58
    $self->finish( { data => "" } );    # We want to clear the job data to avoid storing patron information
57
59
58
}
60
}
(-)a/t/db_dependent/Koha/BackgroundJob/PseudonymizeStatistic.t (-3 / +3 lines)
Lines 68-74 subtest 'enqueue() tests' => sub { Link Here
68
68
69
subtest 'process() tests' => sub {
69
subtest 'process() tests' => sub {
70
70
71
    plan tests => 3;
71
    plan tests => 4;
72
72
73
    $schema->storage->txn_begin;
73
    $schema->storage->txn_begin;
74
74
Lines 103-109 subtest 'process() tests' => sub { Link Here
103
    is( $statistic->{datetime}, $pt_after->last->datetime, "'datetime' column preserved" );
103
    is( $statistic->{datetime}, $pt_after->last->datetime, "'datetime' column preserved" );
104
104
105
    $job->discard_changes;
105
    $job->discard_changes;
106
    is( $job->data, '{"data":""}', "Job data cleared after pseudonymization" );
106
    is( $job->data,     '{"data":""}', "Job data cleared after pseudonymization" );
107
    is( $job->progress, 1,             "Job progress is updated" );
107
108
108
    $schema->storage->txn_rollback;
109
    $schema->storage->txn_rollback;
109
};
110
};
110
- 

Return to bug 41238