diff --git a/controller/Files.py b/controller/Files.py index 10df25d..dc174b5 100644 --- a/controller/Files.py +++ b/controller/Files.py @@ -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( diff --git a/static/js/Wiki.js b/static/js/Wiki.js index f24bf7e..b004202 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -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 );