Skip to content

Commit

Permalink
fix(codec): fix codec bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhiw authored and zibuyu1995 committed Jul 16, 2019
1 parent 0e46893 commit 339524c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/app/services/products/views/codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def validate_output_data(data_dict: Dict, data_stream: DataStream,
continue
value = value_dict.get('value')
time = value_dict.get('time')
if isinstance(time, (int, float)):
if not isinstance(time, (int, float)):
error_dict[data_point_uid] = 'Not a valid time'
if not validate_data_type(point_type, value):
error_dict[data_point_uid] = 'Not a valid value type'
Expand All @@ -292,7 +292,7 @@ def validate_data_type(point_type: int, value: Any) -> bool:
:return: True if valid else False
"""
validate_result = True
if (point_type in (1, 4)) and isinstance(value, (int, float)):
if (point_type in (1, 4)) and not isinstance(value, (int, float)):
validate_result = False
elif point_type == 2 and not isinstance(value, str):
validate_result = False
Expand Down

0 comments on commit 339524c

Please sign in to comment.