mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-30 19:48:18 +08:00
Release team space after update image [SCI-3299] (#1656)
* Release team space after update image
This commit is contained in:
parent
cfbb2a83a6
commit
9377628f5e
1 changed files with 3 additions and 0 deletions
|
@ -152,11 +152,14 @@ class AssetsController < ApplicationController
|
|||
|
||||
def update_image
|
||||
@asset = Asset.find(params[:id])
|
||||
orig_file_size = @asset.file_file_size
|
||||
orig_file_name = @asset.file_file_name
|
||||
return render_403 unless can_read_team?(@asset.team)
|
||||
@asset.file = params[:image]
|
||||
@asset.file_file_name = orig_file_name
|
||||
@asset.save!
|
||||
# release previous image space
|
||||
@asset.team.release_space(orig_file_size)
|
||||
# Post process file here
|
||||
@asset.post_process_file(@asset.team)
|
||||
|
||||
|
|
Loading…
Reference in a new issue