diff options
author | BonfaceKilz | 2020-12-08 18:30:13 +0300 |
---|---|---|
committer | GitHub | 2020-12-08 18:30:13 +0300 |
commit | 8e082d94b8cc9215e736f91ddbb58150947fba7e (patch) | |
tree | 0b4300af5b91318ce76b6a994f47e31abb36ede2 /wqflask/base/trait.py | |
parent | 8bf342d5d02b4023814a79605c3f5f23a7ea67a0 (diff) | |
parent | 97eecd445a1f006400ba162a848353ca5435148a (diff) | |
download | genenetwork2-8e082d94b8cc9215e736f91ddbb58150947fba7e.tar.gz |
Merge branch 'testing' into replace-cytoscape
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) |