1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #5313: Denote official support for Python 3.8

This commit is contained in:
Jeremy Stretch
2020-11-05 16:08:04 -05:00
parent 23cce55246
commit 39b322ae6b
4 changed files with 5 additions and 4 deletions

View File

@ -40,7 +40,7 @@ class ChoiceField(serializers.Field):
return super().validate_empty_values(data)
def to_representation(self, obj):
if obj is '':
if obj == '':
return None
return OrderedDict([
('value', obj),
@ -48,7 +48,7 @@ class ChoiceField(serializers.Field):
])
def to_internal_value(self, data):
if data is '':
if data == '':
if self.allow_blank:
return data
raise ValidationError("This field may not be blank.")