Commit 978001b8 authored by Markus Jylhänkangas's avatar Markus Jylhänkangas
Browse files

Wrap admin deletion in transaction

parent e78cb351
......@@ -1623,13 +1623,12 @@ sub delete_list_admin {
my @u = @_;
my $total = 0;
my $sdm = Sympa::DatabaseManager->instance;
$sdm->begin;
foreach my $who (@u) {
next unless defined $who and length $who;
$who = Sympa::Tools::Text::canonic_email($who);
my $sdm = Sympa::DatabaseManager->instance;
# Delete record in ADMIN
unless (
$sdm
......@@ -1649,6 +1648,12 @@ sub delete_list_admin {
$total--;
}
my $rc = $sdm->commit;
unless ($rc) {
$log->syslog('err', 'Error at add member commit: %s', $sdm->error);
$sdm->rollback;
}
$self->_cache_publish_expiry('admin_user');
return (-1 * $total);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment