mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-18 22:38:44 +00:00
perf: Add last login date update for account on session save
This commit is contained in:
@@ -11,6 +11,7 @@ from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from accounts.models import Account
|
||||
from assets.models import Asset
|
||||
from common.const.signals import OP_LOG_SKIP_SIGNAL
|
||||
from common.utils import get_object_or_none, lazyproperty
|
||||
@@ -125,6 +126,10 @@ class Session(OrgModelMixin):
|
||||
def user_obj(self):
|
||||
return User.objects.get(id=self.user_id)
|
||||
|
||||
@property
|
||||
def account_obj(self):
|
||||
return get_object_or_none(Account, pk=self.account_id)
|
||||
|
||||
def can_replay(self):
|
||||
return self.has_replay
|
||||
|
||||
|
Reference in New Issue
Block a user