mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Fix SyntaxWarning errors on run
This commit is contained in:
parent
2424f684b9
commit
4e02241678
@ -113,7 +113,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),
|
||||
@ -121,7 +121,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.")
|
||||
|
Loading…
Reference in New Issue
Block a user