diff options
author | BonfaceKilz | 2020-12-09 13:45:56 +0300 |
---|---|---|
committer | GitHub | 2020-12-09 13:45:56 +0300 |
commit | 0c7ee32e4b7f71370329516669862e15cd1f09e3 (patch) | |
tree | 17ba1aa21afefe48e894101d95afbbd62fad34a2 /wqflask/base/trait.py | |
parent | cec8e3078784abf0224b23592d56745a09d7060f (diff) | |
parent | 09f69ad0397a6acea9b1f914be8a1d3dbffe814c (diff) | |
download | genenetwork2-0c7ee32e4b7f71370329516669862e15cd1f09e3.tar.gz |
Merge branch 'testing' into replace-jszip
Diffstat (limited to 'wqflask/base/trait.py')
-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) |