-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing how artifact visibility works (#2098)
* changing how artifact visibility works * fixing code * fix errors
- Loading branch information
1 parent
e07a880
commit c309aa6
Showing
7 changed files
with
168 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- Apr 1, 2017 | ||
-- setting visibility of all artifacts to be the most open of the full | ||
-- processing tree | ||
|
||
SELECT 42; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from qiita_db.study import Study | ||
|
||
studies = Study.get_by_status('private').union( | ||
Study.get_by_status('public')).union(Study.get_by_status('sandbox')) | ||
raw_data = [pt.artifact for s in studies for pt in s.prep_templates()] | ||
|
||
for rd in raw_data: | ||
# getting the most open visibility of all the children in the pipeline | ||
children = rd.descendants.nodes() | ||
vis = [a.visibility for a in children] | ||
vis.append(rd.visibility) | ||
|
||
new_vis = 'sandbox' | ||
if 'public' in vis: | ||
new_vis = 'public' | ||
elif 'private' in vis: | ||
new_vis = 'private' | ||
|
||
rd.visibility = new_vis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters