fix: Historical sessions download failed

pull/14344/head
wangruidong 2024-10-22 16:32:06 +08:00 committed by Bryan
parent 1ed1c3a536
commit 9fad591545
1 changed files with 3 additions and 2 deletions

View File

@ -64,8 +64,9 @@ class SessionSerializer(BulkOrgResourceModelSerializer):
return fields
def pop_fields_if_need(self, fields):
if self.context['request'].method != "GET":
fields.pop("command_amount")
request = self.context.get('request')
if request and request.method != 'GET':
fields.pop("command_amount", None)
def validate_asset(self, value):
max_length = self.Meta.model.asset.field.max_length