mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
This may be a little paranoid but don't assume everything has a description.
This commit is contained in:
@@ -100,10 +100,15 @@ class PrimordialModel(models.Model):
|
|||||||
if 'name' in self._meta.get_all_field_names():
|
if 'name' in self._meta.get_all_field_names():
|
||||||
# 0 1
|
# 0 1
|
||||||
# 01234567890123
|
# 01234567890123
|
||||||
old_desc = self.description
|
has_description = False
|
||||||
self.description = "deleted: %s" % self.name
|
if 'description' in self._meta.get_all_field_names():
|
||||||
if old_desc:
|
has_description = True
|
||||||
self.description = "%s (%s)" % (self.description, old_desc)
|
old_desc = ''
|
||||||
|
if has_description:
|
||||||
|
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.name = "_d_%s" % (now().isoformat())
|
||||||
self.active = False
|
self.active = False
|
||||||
if save:
|
if save:
|
||||||
|
|||||||
Reference in New Issue
Block a user