Prevent bug where user account not deleted if changes were pending

devel
Emi Tatsuo 2 years ago
parent 00584c2f27
commit ac9650977b
Signed by: Emi
GPG Key ID: 68FAB2E2E6DFC98B

@ -415,7 +415,10 @@ impl<UserData: Serialize + DeserializeOwned> RegisteredUser<UserData> {
///
/// # Errors
/// Can error if the a database error occurs
pub fn delete(self) -> Result<()> {
pub fn delete(mut self) -> Result<()> {
// Prevent re-saving on drop
self.has_changed = false;
let certificates = self.all_certificates();
(&self.manager.users, &self.manager.certificates, &self.manager.usernames).transaction(|(tx_usr, tx_crt, tx_nam)| {

Loading…
Cancel
Save