mirror of https://github.com/jumpserver/jumpserver
fix: 修复审计日志保存失败的问题
parent
48067415ef
commit
d0e56a17d6
|
@ -69,6 +69,12 @@ class OperateLogStore(object):
|
||||||
before.update(op_before)
|
before.update(op_before)
|
||||||
after.update(op_after)
|
after.update(op_after)
|
||||||
else:
|
else:
|
||||||
|
# 限制长度 128 OperateLog.resource.field.max_length
|
||||||
|
max_length = 128
|
||||||
|
resource = kwargs.get('resource', '')
|
||||||
|
if isinstance(resource, str) and (len(resource) > max_length):
|
||||||
|
# 截取字符串
|
||||||
|
kwargs.update({'resource': resource[:max_length]})
|
||||||
op_log = self.model(**kwargs)
|
op_log = self.model(**kwargs)
|
||||||
|
|
||||||
diff = self.convert_before_after_to_diff(before, after)
|
diff = self.convert_before_after_to_diff(before, after)
|
||||||
|
|
Loading…
Reference in New Issue