mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Fix bug for adding Office files to a result [SCI-9349]
This commit is contained in:
parent
8cf26d7a90
commit
0b069430db
1 changed files with 3 additions and 6 deletions
|
@ -252,14 +252,11 @@ class AssetsController < ApplicationController
|
|||
|
||||
edit_url = edit_asset_url(step_asset.asset_id)
|
||||
elsif params[:element_type] == 'Result'
|
||||
my_module = Result.find(params[:element_id].to_i).my_module
|
||||
render_403 and return unless can_manage_my_module?(my_module)
|
||||
result = Result.find(params[:element_id].to_i)
|
||||
render_403 and return unless can_manage_result?(result)
|
||||
|
||||
# First create result and then the asset
|
||||
result = Result.create(name: asset.file_name,
|
||||
my_module: my_module,
|
||||
user: current_user)
|
||||
result_asset = ResultAsset.create!(result: result, asset: asset)
|
||||
asset.update!(view_mode: result.assets_view_mode)
|
||||
|
||||
edit_url = edit_asset_url(result_asset.asset_id)
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue