diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-09-17 15:49:41 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-09-17 15:49:41 +0200 |
commit | cef9a501246398e799154c75f5b92933c955d76c (patch) | |
tree | 554a360781cdd13c63d769fe80c472e016dfbf4e /pyload | |
parent | more fixes for py2.5 (diff) | |
download | pyload-cef9a501246398e799154c75f5b92933c955d76c.tar.xz |
account deletion fix
Diffstat (limited to 'pyload')
-rw-r--r-- | pyload/remote/wsbackend/Server.py | 3 | ||||
-rw-r--r-- | pyload/web/app/scripts/models/Account.js | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/pyload/remote/wsbackend/Server.py b/pyload/remote/wsbackend/Server.py index d6b25dfda..02da44f04 100644 --- a/pyload/remote/wsbackend/Server.py +++ b/pyload/remote/wsbackend/Server.py @@ -466,7 +466,8 @@ class WebSocketRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler): self, request, client_address, server) except socket.error, e: # Broken pipe, let it pass - if e.errno != 32: + errno = e.args[0] # errno on py < 2.6 + if errno != 32: raise self._logger.debug("WS: Broken pipe") diff --git a/pyload/web/app/scripts/models/Account.js b/pyload/web/app/scripts/models/Account.js index dc453ef3c..26241d8e3 100644 --- a/pyload/web/app/scripts/models/Account.js +++ b/pyload/web/app/scripts/models/Account.js @@ -28,6 +28,14 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt }, + // representation handled by server + toServerJSON: function() { + var data = this.toJSON(); + delete data.config; + + return data; + }, + parse: function(resp) { // Convert config to models resp.config = _.map(resp.config, function(item) { @@ -78,7 +86,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', './ConfigIt }, destroy: function(options) { - options = App.apiRequest('removeAccount', {account: this.toJSON()}, options); + options = App.apiRequest('removeAccount', {account: this.toServerJSON()}, options); var self = this; options.success = function() { self.trigger('destroy', self, self.collection, options); |