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() 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()