mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-26 16:00:34 +00:00
Fix file path management and download bugs
This commit is contained in:
@ -234,7 +234,7 @@ def download_corpus_file(corpus_id, corpus_file_id):
|
||||
or current_user.is_administrator()):
|
||||
abort(403)
|
||||
return send_from_directory(as_attachment=True,
|
||||
directory=corpus_file.corpus.path,
|
||||
directory=os.path.dirname(corpus_file.path),
|
||||
filename=corpus_file.filename)
|
||||
|
||||
|
||||
@ -382,8 +382,7 @@ def inspect_query_result(query_result_id):
|
||||
inspect_display_options_form = InspectDisplayOptionsForm(
|
||||
prefix='inspect-display-options-form'
|
||||
)
|
||||
query_result_file_path = os.path.join(query_result.path, query_result.filename) # noqa
|
||||
with open(query_result_file_path, 'r') as query_result_file:
|
||||
with open(query_result.path, 'r') as query_result_file:
|
||||
query_result_file_content = json.load(query_result_file)
|
||||
return render_template('corpora/query_results/inspect.html.j2',
|
||||
query_result=query_result,
|
||||
@ -413,5 +412,6 @@ def download_query_result(query_result_id):
|
||||
if not (query_result.creator == current_user
|
||||
or current_user.is_administrator()):
|
||||
abort(403)
|
||||
return send_from_directory(as_attachment=True, directory=query_result.path,
|
||||
return send_from_directory(as_attachment=True,
|
||||
directory=os.path.dirname(query_result.path),
|
||||
filename=query_result.filename)
|
||||
|
Reference in New Issue
Block a user