diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm index f0993c89ba..406e0d9a19 100644 --- a/C4/Auth_with_ldap.pm +++ b/C4/Auth_with_ldap.pm @@ -227,6 +227,7 @@ sub checkpw_ldap { map { exists( $borrower{$_} ) ? ( $_ => $borrower{$_} ) : () } @columns } )->store; + $patron->discard_changes; die "Insert of new patron failed" unless $patron; $borrowernumber = $patron->borrowernumber; C4::Members::Messaging::SetMessagingPreferencesFromDefaults(