fix: 删除用户 record 500 (#9058)

Co-authored-by: feng <1304903146@qq.com>
pull/9059/head^2
fit2bot 2022-11-14 17:00:10 +08:00 committed by GitHub
parent 6f135c34c1
commit 7280c6726e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -119,13 +119,21 @@ class OperatorLogHandler(metaclass=Singleton):
resource_display = return_value
return resource_display
@staticmethod
def serialized_value(value: (list, tuple)):
if len(value) == 0:
return ''
if isinstance(value[0], str):
return ','.join(value)
return ','.join([i['value'] for i in value if i.get('value')])
def __data_processing(self, dict_item, loop=True):
encrypt_value = '******'
for key, value in dict_item.items():
if isinstance(value, bool):
value = _('Yes') if value else _('No')
elif isinstance(value, (list, tuple)):
value = ','.join(value)
value = self.serialized_value(value)
elif isinstance(value, dict) and loop:
self.__data_processing(value, loop=False)
if key in encrypted_field_set: