mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 11:40:05 -03:30
When disassociating objects that are foreign key relationships this implies a delete, so also move the name aside to allow for reuse.
This commit is contained in:
@@ -155,6 +155,7 @@ class BaseSubList(BaseList):
|
|||||||
relationship.remove(sub)
|
relationship.remove(sub)
|
||||||
else:
|
else:
|
||||||
# resource is just a ForeignKey, can't remove it from the set, just set it inactive
|
# resource is just a ForeignKey, can't remove it from the set, just set it inactive
|
||||||
|
sub.name = "_deleted_%s_%s" % (str(datetime.time()), sub.name)
|
||||||
sub.active = False
|
sub.active = False
|
||||||
sub.save()
|
sub.save()
|
||||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||||
|
|||||||
Reference in New Issue
Block a user