Merge pull request #10009 from WeiZhixiong/dev

fix: SyntaxWarning, apps/common/drf/parsers/base.py:114, "is" should be "=="
pull/10003/head^2
老广 2023-03-20 09:51:40 +08:00 committed by GitHub
commit 7a35309e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class BaseFileParser(BaseParser):
return {'pk': obj_id, 'name': obj_name} return {'pk': obj_id, 'name': obj_name}
def parse_value(self, field, value): def parse_value(self, field, value):
if value is '-': if value == '-':
return None return None
elif hasattr(field, 'to_file_internal_value'): elif hasattr(field, 'to_file_internal_value'):
value = field.to_file_internal_value(value) value = field.to_file_internal_value(value)