Skip to content

Commit e72ad89

Browse files
authored
Merge pull request #1992 from antgonza/fix-633
Fix 633
2 parents b6d8dfc + 60a53c9 commit e72ad89

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

qiita_pet/handlers/study_handlers/listing_handlers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ def _build_study_info(user, search_type, study_proc=None, proc_samples=None):
7373
# get list of studies for table
7474
if search_type == 'user':
7575
user_study_set = user.user_studies.union(user.shared_studies)
76+
if user.level == 'admin':
77+
user_study_set = (user_study_set |
78+
Study.get_by_status('sandbox') |
79+
Study.get_by_status('private'))
7680
study_set = user_study_set - Study.get_by_status('public')
7781
elif search_type == 'public':
7882
study_set = Study.get_by_status('public')

qiita_pet/handlers/study_handlers/tests/test_listing_handlers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ def test_build_study_info_empty_study(self):
128128

129129
self.assertItemsEqual(obs, self.exp)
130130

131+
# Now testing that admin also sees this study
132+
obs = _build_study_info(User('admin@foo.bar'), 'user')
133+
self.assertEqual(obs, self.exp)
134+
131135

132136
class TestListStudiesHandler(TestHandlerBase):
133137
def test_get(self):

0 commit comments

Comments
 (0)