Browse Source

TreeManager should provide an unrestricted QuerySet for MPTT use

Jeremy Stretch 5 years ago
parent
commit
327a93136a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      netbox/utilities/mptt.py

+ 5 - 1
netbox/utilities/mptt.py

@@ -16,4 +16,8 @@ class TreeManager(Manager.from_queryset(TreeQuerySet), TreeManager_):
     """
     """
     Extend django-mptt's TreeManager to incorporate RestrictedQuerySet().
     Extend django-mptt's TreeManager to incorporate RestrictedQuerySet().
     """
     """
-    pass
+    def db_manager(self, using=None, hints=None):
+        manager = super().db_manager(using, hints)
+
+        # Return an unrestricted QuerySet for use by MPTT
+        return manager.unrestricted()