fixed error when deleting item without the children
This commit is contained in:
parent
281450341d
commit
a2230c9077
@ -164,7 +164,7 @@ class ItemDelete(DeleteView):
|
|||||||
self.object.delete()
|
self.object.delete()
|
||||||
messages.success(request, _("Item <b>%s</b> and his children were successfully deleted.") % self.object)
|
messages.success(request, _("Item <b>%s</b> and his children were successfully deleted.") % self.object)
|
||||||
else:
|
else:
|
||||||
for child in self.object.children:
|
for child in self.object.get_children():
|
||||||
child.parent = self.object.parent
|
child.parent = self.object.parent
|
||||||
child.save()
|
child.save()
|
||||||
self.object.delete()
|
self.object.delete()
|
||||||
|
Loading…
Reference in New Issue
Block a user