mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
fixes bug with organization
This commit is contained in:
parent
210519b506
commit
15b1712a3d
1 changed files with 7 additions and 7 deletions
|
@ -199,13 +199,13 @@ class WopiController < ActionController::Base
|
|||
if @asset.lock == lock
|
||||
logger.warn 'WOPI: replacing file'
|
||||
|
||||
@organization.release_space(@asset.estimated_size)
|
||||
@team.release_space(@asset.estimated_size)
|
||||
@asset.update_contents(request.body)
|
||||
@asset.last_modified_by = @user
|
||||
@asset.save
|
||||
|
||||
@organization.take_space(@asset.estimated_size)
|
||||
@organization.save
|
||||
@team.take_space(@asset.estimated_size)
|
||||
@team.save
|
||||
|
||||
@protocol.update(updated_at: Time.now) if @protocol
|
||||
|
||||
|
@ -219,11 +219,11 @@ class WopiController < ActionController::Base
|
|||
elsif !@asset.file_file_size.nil? && @asset.file_file_size.zero?
|
||||
logger.warn 'WOPI: initializing empty file'
|
||||
|
||||
@organization.release_space(@asset.estimated_size)
|
||||
@team.release_space(@asset.estimated_size)
|
||||
@asset.update_contents(request.body)
|
||||
@asset.last_modified_by = @user
|
||||
@asset.save
|
||||
@organization.save
|
||||
@team.save
|
||||
|
||||
response.headers['X-WOPI-ItemVersion'] = @asset.version
|
||||
render nothing: :true, status: 200 and return
|
||||
|
@ -248,10 +248,10 @@ class WopiController < ActionController::Base
|
|||
|
||||
if @assoc.class == Step
|
||||
@protocol = @asset.step.protocol
|
||||
@organization = @protocol.organization
|
||||
@team = @protocol.team
|
||||
else
|
||||
@my_module = @assoc.my_module
|
||||
@organization = @my_module.experiment.project.organization
|
||||
@team = @my_module.experiment.project.team
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue