mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-21 10:09:33 +00:00
[Update] 登录日志导出按照组织进行过滤
This commit is contained in:
parent
4e1e60046a
commit
ff62968bf6
@ -6,6 +6,7 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from orgs.mixins.models import OrgModelMixin
|
from orgs.mixins.models import OrgModelMixin
|
||||||
|
from orgs.utils import current_org
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'FTPLog', 'OperateLog', 'PasswordChangeLog', 'UserLoginLog',
|
'FTPLog', 'OperateLog', 'PasswordChangeLog', 'UserLoginLog',
|
||||||
@ -104,6 +105,9 @@ class UserLoginLog(models.Model):
|
|||||||
Q(city__contains=keyword) |
|
Q(city__contains=keyword) |
|
||||||
Q(username__contains=keyword)
|
Q(username__contains=keyword)
|
||||||
)
|
)
|
||||||
|
if not current_org.is_root():
|
||||||
|
username_list = current_org.get_org_members().values_list('username', flat=True)
|
||||||
|
login_logs = login_logs.filter(username__in=username_list)
|
||||||
return login_logs
|
return login_logs
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
Loading…
Reference in New Issue
Block a user