diff options
author | BonfaceKilz | 2020-10-01 18:16:45 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-10-01 18:16:45 +0300 |
commit | 4aa6c2dc7d6e74316e793f219a6a44411fbef5ac (patch) | |
tree | 6103785d82f42fc46cd68c8bde2b59989625b412 /wqflask | |
parent | 968bc7d468b2a24ded48b4deeb76b216ddb9a350 (diff) | |
download | genenetwork2-4aa6c2dc7d6e74316e793f219a6a44411fbef5ac.tar.gz |
Convert trait attributes to utf-8 strings if they were bytes
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/base/trait.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index d0c79119..24d0476d 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -147,7 +147,8 @@ class GeneralTrait(object): formatted = self.post_publication_description else: formatted = "Not available" - + if isinstance(formatted, bytes): + formatted = formatted.decode("utf-8") return formatted @property @@ -495,6 +496,8 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False): trait.haveinfo = True for i, field in enumerate(dataset.display_fields): holder = trait_info[i] + if isinstance(holder, bytes): + holder = holder.decode('utf-8') setattr(trait, field, holder) if dataset.type == 'Publish': |