Skip to content

Commit

Permalink
Fix #686: Use the correct database when rebuilding
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Sep 7, 2020
1 parent a4e2acf commit 77a3134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mptt/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def _rebuild_helper(self, pk, left, tree_id, level=0):
for child_id in child_ids:
right = rebuild_helper(child_id, right, tree_id, level + 1)

qs = self.model._default_manager.filter(pk=pk)
qs = self.model._default_manager.db_manager(self.db).filter(pk=pk)
self._mptt_update(qs, left=left, right=right, level=level, tree_id=tree_id)

return right + 1
Expand Down

0 comments on commit 77a3134

Please sign in to comment.