From f04fd00f17125382195955322d88b75e3e01d20e Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Mon, 19 Feb 2024 16:09:16 +0100 Subject: [PATCH] Log user deletion event --- backend/iam/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/iam/models.py b/backend/iam/models.py index ef459e820..9a9d7af33 100644 --- a/backend/iam/models.py +++ b/backend/iam/models.py @@ -320,6 +320,10 @@ class Meta: # swappable = 'AUTH_USER_MODEL' permissions = (("backup", "backup"), ("restore", "restore")) + def delete(self, *args, **kwargs): + super().delete(*args, **kwargs) + logger.info("user deleted", user=self) + def __str__(self): return ( f"{self.first_name} {self.last_name}"