Fixed updating and display of storage usage when an uploaded file is deleted.
This commit is contained in:
parent
e0c65a6ac4
commit
6a5481f7d6
|
@ -491,11 +491,10 @@ class Files( object ):
|
|||
if not db_file or not self.__users.check_access( user_id, db_file.notebook_id, read_write = True ):
|
||||
raise Access_error()
|
||||
|
||||
user = self.__database.load( User, user_id )
|
||||
if not user:
|
||||
raise Access_error()
|
||||
self.__database.execute( db_file.sql_delete(), commit = False )
|
||||
user = self.__users.update_storage( user_id, commit = False )
|
||||
self.__database.commit()
|
||||
|
||||
self.__database.execute( db_file.sql_delete() )
|
||||
os.remove( Upload_file.make_server_filename( file_id ) )
|
||||
|
||||
return dict(
|
||||
|
|
|
@ -2356,12 +2356,10 @@ Upload_pulldown.prototype.shutdown = function ( force, display_quota_error ) {
|
|||
// if there's an upload in progress and the force flag is not set, then bail without performing a
|
||||
// shutdown
|
||||
if ( this.uploading ) {
|
||||
if ( force ) {
|
||||
if ( !display_quota_error )
|
||||
this.wiki.display_message( "The file upload has been cancelled." )
|
||||
} else {
|
||||
if ( !force )
|
||||
return;
|
||||
}
|
||||
if ( !display_quota_error )
|
||||
this.wiki.display_message( "The file upload has been cancelled." )
|
||||
}
|
||||
|
||||
Pulldown.prototype.shutdown.call( this );
|
||||
|
|
Reference in New Issue