|
|
|
@ -305,6 +305,8 @@ def solar(text):
|
|
|
|
|
show_upload_form = True
|
|
|
|
|
contract_school = portal.solar.get_institution_contract(current_user_institution.id)
|
|
|
|
|
cooperation_history = portal.solar.get_institution_cooperation_history(current_user_institution.id)
|
|
|
|
|
logging.info('TEEEEEEEEEEEEEEEEEEEEEEEsst')
|
|
|
|
|
logging.info(cooperation_history[0].name)
|
|
|
|
|
if portal.solar.is_institution_coordinator(current_user_obj.id, current_user_institution.id):
|
|
|
|
|
contracts_students = portal.solar.get_institution_student_contracts(current_user_institution.id)
|
|
|
|
|
enable_upload_school_contract = True
|
|
|
|
@ -761,19 +763,23 @@ def get_upload_file(upload_id, file_hash):
|
|
|
|
|
if file_hash not in upload_obj.upload_file_hashes:
|
|
|
|
|
return '', 404
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prefix = file_hash[:2]
|
|
|
|
|
suffix = file_hash[2:]
|
|
|
|
|
safe_path = safe_join(str(upload_handler_solar.get_uploads_subdir('files')), prefix, suffix)
|
|
|
|
|
f_name = os.listdir(safe_path)[0]
|
|
|
|
|
|
|
|
|
|
f_name = os.listdir(safe_path)[0]
|
|
|
|
|
safe_path = safe_join(safe_path, f_name)
|
|
|
|
|
|
|
|
|
|
f_suffix = f_name.split('.')[-1]
|
|
|
|
|
f_dlname = upload_obj.upload_file_codes[file_hashes.index(file_hash)]
|
|
|
|
|
if f_suffix in portal.solar.UploadHandlerSolar.ENABLED_FILETYPES:
|
|
|
|
|
f_dlname += '.' + f_suffix
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
return send_file(safe_path, attachment_filename=f_name, as_attachment=True)
|
|
|
|
|
return send_file(safe_path, attachment_filename=f_dlname, as_attachment=True)
|
|
|
|
|
except FileNotFoundError:
|
|
|
|
|
return '', 404
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
app.run(debug=True)
|
|
|
|
|