mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-26 22:01:34 +00:00
Big update, corpus analysis reworked, versioned services, preliminary work for contributions
This commit is contained in:
@@ -34,12 +34,14 @@ def delete_job(job_id):
|
||||
@login_required
|
||||
def download_job_input(job_id, job_input_id):
|
||||
job_input = JobInput.query.filter(JobInput.job_id == job_id, JobInput.id == job_input_id).first_or_404() # noqa
|
||||
if not (job_input.job.user == current_user
|
||||
or current_user.is_administrator()):
|
||||
if not (job_input.job.user == current_user or current_user.is_administrator()): # noqa
|
||||
abort(403)
|
||||
return send_from_directory(as_attachment=True,
|
||||
directory=os.path.dirname(job_input.path),
|
||||
filename=job_input.filename)
|
||||
return send_from_directory(
|
||||
as_attachment=True,
|
||||
attachment_filename=job_input.filename,
|
||||
directory=os.path.dirname(job_input.path),
|
||||
filename=os.path.basename(job_input.path)
|
||||
)
|
||||
|
||||
|
||||
@bp.route('/<hashid:job_id>/restart')
|
||||
@@ -59,9 +61,11 @@ def restart(job_id):
|
||||
@login_required
|
||||
def download_job_result(job_id, job_result_id):
|
||||
job_result = JobResult.query.filter(JobResult.job_id == job_id, JobResult.id == job_result_id).first_or_404() # noqa
|
||||
if not (job_result.job.user == current_user
|
||||
or current_user.is_administrator()):
|
||||
if not (job_result.job.user == current_user or current_user.is_administrator()): # noqa
|
||||
abort(403)
|
||||
return send_from_directory(as_attachment=True,
|
||||
directory=os.path.dirname(job_result.path),
|
||||
filename=job_result.filename)
|
||||
return send_from_directory(
|
||||
as_attachment=True,
|
||||
attachment_filename=job_result.filename,
|
||||
directory=os.path.dirname(job_result.path),
|
||||
filename=os.path.basename(job_result.path)
|
||||
)
|
||||
|
Reference in New Issue
Block a user