diff options
author | BonfaceKilz | 2020-12-08 18:37:34 +0300 |
---|---|---|
committer | GitHub | 2020-12-08 18:37:34 +0300 |
commit | 7f5c29b54ccdc09eae82bbcdcc0ff1b0342b1626 (patch) | |
tree | a98e9a3c85c50ae91a7a5cd45d2a8ea406fb49f7 /wqflask/base | |
parent | 1995fbcf19645feaa1aabbab921e90c6877b4c4d (diff) | |
parent | df5361f36d98fa53727cf1f71682ec9a9f3b3ec4 (diff) | |
download | genenetwork2-7f5c29b54ccdc09eae82bbcdcc0ff1b0342b1626.tar.gz |
Merge branch 'testing' into replace-purescript-genome-browser
Diffstat (limited to 'wqflask/base')
-rw-r--r-- | wqflask/base/trait.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index ec8c40a0..50bd8874 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -25,19 +25,19 @@ def create_trait(**kw): assert bool(kw.get('dataset')) != bool( kw.get('dataset_name')), "Needs dataset ob. or name" - if kw.get('name'): - if kw.get('dataset_name'): - if kw.get('dataset_name') != "Temp": - dataset = create_dataset(kw.get('dataset_name')) - else: - dataset = kw.get('dataset') + assert bool(kw.get('name')), "Needs trait name" + if kw.get('dataset_name'): if kw.get('dataset_name') != "Temp": - if dataset.type == 'Publish': - permissions = check_resource_availability( - dataset, kw.get('name')) - else: - permissions = check_resource_availability(dataset) + dataset = create_dataset(kw.get('dataset_name')) + else: + dataset = kw.get('dataset') + + if dataset.type == 'Publish': + permissions = check_resource_availability( + dataset, kw.get('name')) + else: + permissions = check_resource_availability(dataset) if "view" in permissions['data']: the_trait = GeneralTrait(**kw) |