@@ -57,21 +57,13 @@ def get(self, study_id):
57
57
str (study_id )))
58
58
59
59
study = Study (study_id )
60
- user = self .current_user
61
60
basedir = get_db_files_base_dir ()
62
61
basedir_len = len (basedir ) + 1
63
62
# loop over artifacts and retrieve those that we have access to
64
63
to_download = []
65
- vfabu = validate_filepath_access_by_user
66
64
for a in study .artifacts ():
67
65
if a .artifact_type == 'BIOM' :
68
- to_add = True
69
66
for i , (fid , path , data_type ) in enumerate (a .filepaths ):
70
- # validate access only of the first artifact filepath,
71
- # the rest have the same permissions
72
- if (i == 0 and not vfabu (user , fid )):
73
- to_add = False
74
- break
75
67
# ignore if tgz as they could create problems and the
76
68
# raw data is in the folder
77
69
if data_type == 'tgz' :
@@ -97,16 +89,15 @@ def get(self, study_id):
97
89
# how to trigger it
98
90
to_download .append ((path , path , path ))
99
91
100
- if to_add :
101
- for pt in a .prep_templates :
102
- qmf = pt .qiime_map_fp
103
- if qmf is not None :
104
- sqmf = qmf
105
- if qmf .startswith (basedir ):
106
- sqmf = qmf [basedir_len :]
107
- to_download .append (
108
- (qmf , sqmf , 'mapping_files/%s_mapping_file.txt'
109
- % a .id ))
92
+ for pt in a .prep_templates :
93
+ qmf = pt .qiime_map_fp
94
+ if qmf is not None :
95
+ sqmf = qmf
96
+ if qmf .startswith (basedir ):
97
+ sqmf = qmf [basedir_len :]
98
+ to_download .append (
99
+ (qmf , sqmf , 'mapping_files/%s_mapping_file.txt'
100
+ % a .id ))
110
101
111
102
# If we don't have nginx, write a file that indicates this
112
103
all_files = '\n ' .join (["- %s /protected/%s %s" % (getsize (fp ), sfp , n )
@@ -172,16 +163,9 @@ def get(self, study_id):
172
163
basedir_len = len (basedir ) + 1
173
164
# loop over artifacts and retrieve raw data (no parents)
174
165
to_download = []
175
- vfabu = validate_filepath_access_by_user
176
166
for a in study .artifacts ():
177
167
if not a .parents :
178
- to_add = True
179
168
for i , (fid , path , data_type ) in enumerate (a .filepaths ):
180
- # validate access only of the first artifact filepath,
181
- # the rest have the same permissions
182
- if (i == 0 and not vfabu (user , fid )):
183
- to_add = False
184
- break
185
169
if data_type == 'directory' :
186
170
# If we have a directory, we actually need to list
187
171
# all the files from the directory so NGINX can
@@ -203,16 +187,15 @@ def get(self, study_id):
203
187
# how to trigger it
204
188
to_download .append ((path , path , path ))
205
189
206
- if to_add :
207
- for pt in a .prep_templates :
208
- qmf = pt .qiime_map_fp
209
- if qmf is not None :
210
- sqmf = qmf
211
- if qmf .startswith (basedir ):
212
- sqmf = qmf [basedir_len :]
213
- to_download .append (
214
- (qmf , sqmf , 'mapping_files/%s_mapping_file.txt'
215
- % a .id ))
190
+ for pt in a .prep_templates :
191
+ qmf = pt .qiime_map_fp
192
+ if qmf is not None :
193
+ sqmf = qmf
194
+ if qmf .startswith (basedir ):
195
+ sqmf = qmf [basedir_len :]
196
+ to_download .append (
197
+ (qmf , sqmf , 'mapping_files/%s_mapping_file.txt'
198
+ % a .id ))
216
199
217
200
# If we don't have nginx, write a file that indicates this
218
201
# Note that this configuration will automatically create and download
0 commit comments