fixed error when deleting item without the children

This commit is contained in:
Oskar Hahn 2012-02-21 13:36:00 +01:00
parent 281450341d
commit a2230c9077

View File

@ -164,7 +164,7 @@ class ItemDelete(DeleteView):
self.object.delete()
messages.success(request, _("Item <b>%s</b> and his children were successfully deleted.") % self.object)
else:
for child in self.object.children:
for child in self.object.get_children():
child.parent = self.object.parent
child.save()
self.object.delete()