fix: saml 用户没现在记录 (#11641)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-09-21 14:02:09 +08:00
committed by GitHub
parent 803d590096
commit b023ca0c69
3 changed files with 17 additions and 7 deletions

View File

@@ -268,7 +268,10 @@ class UserSessionViewSet(CommonApiMixin, viewsets.ModelViewSet):
return user_ids
def get_queryset(self):
queryset = UserSession.objects.filter(date_expired__gt=timezone.now())
keys = UserSession.get_keys()
queryset = UserSession.objects.filter(
date_expired__gt=timezone.now(), key__in=keys
)
if current_org.is_root():
return queryset
user_ids = self.org_user_ids