mirror of https://github.com/jumpserver/jumpserver
fix: Accounts of ssh key type will no longer export fingerprints. (#13215)
Co-authored-by: feng <1304903146@qq.com>pull/13218/head
parent
0ea675f8d6
commit
e8faaeb8fb
|
@ -43,6 +43,17 @@ class SecretReadableMixin(serializers.Serializer):
|
||||||
if 'write_only' not in field_extra_kwargs:
|
if 'write_only' not in field_extra_kwargs:
|
||||||
continue
|
continue
|
||||||
serializer_field.write_only = field_extra_kwargs['write_only']
|
serializer_field.write_only = field_extra_kwargs['write_only']
|
||||||
|
self.remove_spec_info_field()
|
||||||
|
|
||||||
|
def remove_spec_info_field(self):
|
||||||
|
request = self.context.get('request')
|
||||||
|
if not request:
|
||||||
|
return
|
||||||
|
|
||||||
|
_format = request.query_params.get('format')
|
||||||
|
if _format not in ['csv', 'xlsx']:
|
||||||
|
return
|
||||||
|
self.fields.pop('spec_info', None)
|
||||||
|
|
||||||
|
|
||||||
class BulkSerializerMixin(object):
|
class BulkSerializerMixin(object):
|
||||||
|
|
Loading…
Reference in New Issue