Skip to content

Commit

Permalink
Merge pull request #1992 from antgonza/fix-633
Browse files Browse the repository at this point in the history
Fix 633
  • Loading branch information
ElDeveloper committed Nov 10, 2016
2 parents b6d8dfc + 60a53c9 commit e72ad89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qiita_pet/handlers/study_handlers/listing_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def _build_study_info(user, search_type, study_proc=None, proc_samples=None):
# get list of studies for table
if search_type == 'user':
user_study_set = user.user_studies.union(user.shared_studies)
if user.level == 'admin':
user_study_set = (user_study_set |
Study.get_by_status('sandbox') |
Study.get_by_status('private'))
study_set = user_study_set - Study.get_by_status('public')
elif search_type == 'public':
study_set = Study.get_by_status('public')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ def test_build_study_info_empty_study(self):

self.assertItemsEqual(obs, self.exp)

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


class TestListStudiesHandler(TestHandlerBase):
def test_get(self):
Expand Down

0 comments on commit e72ad89

Please sign in to comment.