mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 16:31:33 +00:00
perf: 优化禁用用户
This commit is contained in:
@@ -10,7 +10,7 @@ from django.utils import timezone
|
||||
from django.utils.translation import gettext, gettext_lazy as _
|
||||
|
||||
from common.db.encoder import ModelJSONFieldEncoder
|
||||
from common.utils import lazyproperty
|
||||
from common.utils import lazyproperty, i18n_trans
|
||||
from ops.models import JobExecution
|
||||
from orgs.mixins.models import OrgModelMixin, Organization
|
||||
from orgs.utils import current_org
|
||||
@@ -155,6 +155,10 @@ class ActivityLog(OrgModelMixin):
|
||||
verbose_name = _("Activity log")
|
||||
ordering = ('-datetime',)
|
||||
|
||||
def __str__(self):
|
||||
detail = i18n_trans(self.detail)
|
||||
return "{} {}".format(detail, self.resource_id)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if current_org.is_root() and not self.org_id:
|
||||
self.org_id = Organization.ROOT_ID
|
||||
|
Reference in New Issue
Block a user