fix: Historical sessions download failed

pull/14146/head
wangruidong 2024-09-13 14:35:12 +08:00 committed by Bryan
parent e997236159
commit 50f075cc7e
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