Skip to content

Commit 7d96e3a

Browse files
committed
BUG: Fix problem with default basedir
If the base data directory was not set, a default one would be selected, by using '..' to refer to a directory below, which in turn would inconsistently flag users as lacking permissions: ``` QiitaPetAuthorizationError: User demo@microbio.me is not authorized to access /Users/yoshikivazquezbaeza/.virtualenvs/qiita-0.2.0-rc1/lib/python2.7/site-packages/qiita_db/support_files/test_data/job/1_summarize_taxa_through_plots.py_output_dir/taxa_summary_plots/bar_charts.html ``` Although the paths were the same, this is verified through string matching thus 'lol/foo/../jk' and 'lol/jk' would not match (see example structure below) even though they refer to the same folder: lol/ ├── foo │   └── file.txt ├── jk └── plel
1 parent a03564a commit 7d96e3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qiita_core/configuration_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ def __init__(self):
144144
def _get_main(self, config):
145145
"""Get the configuration of the main section"""
146146
self.test_environment = config.getboolean('main', 'TEST_ENVIRONMENT')
147-
default_base_data_dir = join(dirname(abspath(__file__)),
148-
'..', 'qiita_db', 'support_files',
147+
install_dir = dirname(dirname(abspath(__file__)))
148+
default_base_data_dir = join(install_dir, 'qiita_db', 'support_files',
149149
'test_data')
150150
self.base_data_dir = config.get('main', 'BASE_DATA_DIR') or \
151151
default_base_data_dir

0 commit comments

Comments
 (0)