aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorBonfaceKilz2020-12-09 11:28:46 +0300
committerGitHub2020-12-09 11:28:46 +0300
commit7f65cee7be7ca0cc643c78b28763594b000ed4a1 (patch)
tree63a280f524a9de67bf4d73e25cd55dc730addb7f /wqflask/base/trait.py
parent713e1798256c01ab8b29f2f6209987091d8b08bf (diff)
parent0edd6f931c0204f9cc2a0e64cc5fd7a983e6767d (diff)
downloadgenenetwork2-7f65cee7be7ca0cc643c78b28763594b000ed4a1.tar.gz
Merge branch 'testing' into replace-colorbox
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r--wqflask/base/trait.py22
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)