fix: 修复一些 Root 组织没数据的问题

This commit is contained in:
xinwen
2021-03-18 16:44:32 +08:00
committed by Jiangjie.Bai
parent 33952b2333
commit b597cfcd19
3 changed files with 6 additions and 5 deletions

View File

@@ -165,7 +165,7 @@ class SystemUserBackend(DBBackend):
kwargs = self.get_annotate()
filters = self.get_filter()
qs = self.model.objects.all().annotate(**kwargs)
if current_org.org_id() is not None:
if not current_org.is_root():
filters['org_id'] = current_org.org_id()
qs = qs.filter(**filters)
qs = self.qs_to_values(qs)