Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion polymorphic_tree/admin/parentadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def api_node_moved_view(self, request):
# This is required by django-fluent-pages for example to update the URL caches.
# Make sure the updated version (with new parent_id/lft/rgt fields is fetched)
moved = self.model.objects.get(pk=moved_id)
moved.save()
moved.save(previous_parent_id=previous_parent_id)

# Report back to client.
return HttpResponse(json.dumps({
Expand Down
4 changes: 4 additions & 0 deletions polymorphic_tree/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ class Meta:
# class MPTTMeta:
# order_insertion_by = 'title'

def save(self, *args, **kwargs):
# from parentadmin.PolymorphicMPTTParentModelAdmin.api_node_moved_view()
kwargs.pop('previous_parent_id', None)
return super(PolymorphicMPTTModel, self).save(*args, **kwargs)

# South integration
try:
Expand Down