mirror of https://github.com/jumpserver/jumpserver
Merge pull request #9877 from jumpserver/pr@v2.28@fix_operatelog_hide_sth
fix: 操作日志显示用户加密后的密文,及日期格式调整pull/9902/head
commit
c01d1973d9
|
@ -2,13 +2,14 @@ import csv
|
|||
import codecs
|
||||
|
||||
from itertools import chain
|
||||
from datetime import datetime
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.db import models
|
||||
|
||||
from settings.serializers import SettingsSerializer
|
||||
from common.utils.timezone import as_current_tz
|
||||
from common.utils import validate_ip, get_ip_city, get_logger
|
||||
from common.db import fields
|
||||
from .const import DEFAULT_CITY
|
||||
|
||||
|
||||
|
@ -78,6 +79,8 @@ def model_to_dict_for_operate_log(
|
|||
f.verbose_name = 'id'
|
||||
elif isinstance(value, list):
|
||||
value = [str(v) for v in value]
|
||||
elif isinstance(value, datetime):
|
||||
value = as_current_tz(value).strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
||||
if include_model_fields or getattr(f, 'primary_key', False):
|
||||
data[str(f.verbose_name)] = value
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from werkzeug.local import Local
|
||||
|
||||
thread_local = Local()
|
||||
encrypted_field_set = set()
|
||||
encrypted_field_set = {'password'}
|
||||
|
||||
|
||||
def _find(attr):
|
||||
|
|
Loading…
Reference in New Issue