diff --git a/awx/main/management/commands/cleanup_deleted.py b/awx/main/management/commands/cleanup_deleted.py index 84ead9b585..d898a42f7c 100644 --- a/awx/main/management/commands/cleanup_deleted.py +++ b/awx/main/management/commands/cleanup_deleted.py @@ -55,7 +55,7 @@ class Command(BaseCommand): return qs = model.objects.filter(**{ active_field: False, - '%s__startswith' % name_field: '_deleted_', + '%s__startswith' % name_field: '_d', }) self.logger.debug('cleaning up model %s', model) for instance in qs: diff --git a/awx/main/models/__init__.py b/awx/main/models/__init__.py index c363da4cb2..5d44074ddc 100644 --- a/awx/main/models/__init__.py +++ b/awx/main/models/__init__.py @@ -98,7 +98,13 @@ class PrimordialModel(models.Model): if self.active: if 'name' in self._meta.get_all_field_names(): - self.name = "_deleted_%s_%s" % (now().isoformat(), self.name) + # 0 1 + # 01234567890123 + old_desc = self.description + self.description = "deleted: %s" % self.name + if old_desc: + self.description = "%s (%s)" % (self.description, old_desc) + self.name = "_d_%s" % (now().isoformat()) self.active = False if save: self.save()