# Mass delete command

* introduces new command for mass deleting entries based on specific pattern in identifier
    * command guides user through parameter collecting process
This commit is contained in:
2026-07-16 10:38:00 +02:00
parent 112b74f5cd
commit 02ce78551c
4 changed files with 122 additions and 6 deletions
+4 -2
View File
@@ -92,13 +92,15 @@ class DeletableObjectMixin(models.Model):
class Meta:
abstract = True
def mark_as_deleted(self, user, send_mail: bool = True):
def mark_as_deleted(self, user, send_mail: bool = True, comment: str|None = None):
""" Mark an entry as deleted
Does not delete from database but sets a timestamp for being deleted on and which user deleted the object
Args:
user (User): The performing user
send_mail (bool): Whether to send mails to users and teams
comment (str|None): The comment for delete action
Returns:
@@ -109,7 +111,7 @@ class DeletableObjectMixin(models.Model):
return
with transaction.atomic():
action = UserActionLogEntry.get_deleted_action(user)
action = UserActionLogEntry.get_deleted_action(user, comment)
self.deleted = action
self.log.add(action)