Skip to content

Commit

Permalink
🐛Fix error raised due to field value not being actual binary
Browse files Browse the repository at this point in the history
- Fixes yezyilomo#43
  • Loading branch information
yezyilomo committed Jul 9, 2020
1 parent 1783b6c commit 1c9dc0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def build_flat_field(cls, rec, field_name):
return {
field_name: rec[field_name].strftime("%H-%M-%S")
}
elif field_type == "binary" and rec[field_name]:
elif field_type == "binary" and isinstance(rec[field_name], bytes) and rec[field_name]:
return {field_name: rec[field_name].decode("utf-8")}
else:
return {field_name: rec[field_name]}
Expand Down

0 comments on commit 1c9dc0e

Please sign in to comment.