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

(-)a/Koha/Patron.pm (-1 / +1 lines)
Lines 318-324 sub delete { Link Here
318
    my ($self) = @_;
318
    my ($self) = @_;
319
319
320
    unless ( $self->borrowernumber > 0 ) {
320
    unless ( $self->borrowernumber > 0 ) {
321
        Koha::Exceptions::CannotDeleteDefault->throw(
321
        Koha::Exceptions::Patron::FailedDelete->throw(
322
            { message => "Cannot delete system user" } );
322
            { message => "Cannot delete system user" } );
323
    }
323
    }
324
324
(-)a/t/db_dependent/Koha/Patrons.t (-1 / +2 lines)
Lines 395-400 subtest "delete" => sub { Link Here
395
395
396
    my $number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'DELETE', object => $retrieved_patron->borrowernumber } )->count;
396
    my $number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'DELETE', object => $retrieved_patron->borrowernumber } )->count;
397
    is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->delete should have logged' );
397
    is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->delete should have logged' );
398
    my $system_patron = Koha::Patrons->find('-1');
399
    throws_ok { $system_patron->delete } 'Koha::Exceptions::Patron::FailedDelete', 'Exception raised for deleting system patron';
398
};
400
};
399
401
400
subtest 'Koha::Patrons->delete' => sub {
402
subtest 'Koha::Patrons->delete' => sub {
401
- 

Return to bug 22577