Browse Source

fix: User import fails if MFA field is set to Disabled (0)

pull/14418/head
wangruidong 2 weeks ago committed by Bryan
parent
commit
b01916001e
  1. 2
      apps/common/drf/parsers/base.py

2
apps/common/drf/parsers/base.py

@ -126,7 +126,7 @@ class BaseFileParser(BaseParser):
value = self.id_name_to_obj(value)
elif isinstance(field, LabeledChoiceField):
value = self.id_name_to_obj(value)
if isinstance(value, dict) and value.get('pk'):
if isinstance(value, dict) and 'pk' in value:
value = value.get('pk')
elif isinstance(field, serializers.ListSerializer):
value = [self.parse_value(field.child, v) for v in value]

Loading…
Cancel
Save