From b6f829d93903082a0ebea90adebdb5e13b4f002c Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Fri, 30 Jul 2010 23:46:50 +0200 Subject: [PATCH] include the server ID in the update() call --- htdocs/js/usereditor.js | 3 ++- pyweb/mumble/views.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/js/usereditor.js b/htdocs/js/usereditor.js index 2228426..3bdaf85 100644 --- a/htdocs/js/usereditor.js +++ b/htdocs/js/usereditor.js @@ -100,6 +100,7 @@ Ext.ux.UserEditorPanel = function( config ){ } }, { text: gettext("Save"), + scope: this, handler : function(){ var data = []; for( i = 0; i < userAdminStore.data.items.length; i++ ){ @@ -108,7 +109,7 @@ Ext.ux.UserEditorPanel = function( config ){ data.push(rec.data); } } - MumbleUserAdmin.update( data, function(provider, response){ + MumbleUserAdmin.update( this.server, data, function(provider, response){ if( response.result.success ){ for( i = 0; i < userAdminStore.data.items.length; i++ ){ rec = userAdminStore.data.items[i]; diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index ccdf5c0..f5f153d 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -261,7 +261,8 @@ def djangousers( request ): return users @EXT_DIRECT_PROVIDER.register_method( "MumbleUserAdmin" ) -def update( request, data ): +def update( request, server, data ): + srv = get_object_or_404( Mumble, id=int(server) ) for record in data: if record['id'] == -1: if record['delete']: