diff --git a/pyweb/djextdirect.py b/pyweb/djextdirect.py index 2ca0cb4..cf2d0b4 100644 --- a/pyweb/djextdirect.py +++ b/pyweb/djextdirect.py @@ -68,10 +68,18 @@ Ext.ux.%(clsname)s = function( config ){ Ext.extend( Ext.ux.%(clsname)s, Ext.form.FormPanel, { load: function(){ - this.getForm().load({ params: {pk: this.pk} }); + this.getForm().load({ params: Ext.applyIf( {pk: this.pk}, this.baseParams ) }); }, submit: function(){ - this.getForm().submit({ params: {pk: this.pk} }); + this.getForm().submit({ + params: Ext.applyIf( {pk: this.pk}, this.baseParams ), + failure: function( form, action ){ + if( action.failureType == Ext.form.Action.SERVER_INVALID && + typeof action.result.errors[''] != 'undefined' ){ + Ext.Msg.alert( "Error", action.result.errors[''] ); + } + } + }); }, } ); @@ -483,6 +491,7 @@ class Provider( object ): 'fileUpload: ' + simplejson.dumps(hasfiles) + ',' 'defaults: { "anchor": "-20px" },' 'paramsAsHash: true,' + 'baseParams: {},' 'autoScroll: true,' """buttons: [{ text: "Submit", diff --git a/pyweb/mumble/templates/mumble/mumble.html b/pyweb/mumble/templates/mumble/mumble.html index 3fe1d47..fbb601c 100644 --- a/pyweb/mumble/templates/mumble/mumble.html +++ b/pyweb/mumble/templates/mumble/mumble.html @@ -72,9 +72,7 @@ xtype: "{{ RegForm|lower }}", pk: {% if MumbleAccount %}{{ MumbleAccount.id }}{% else %}-1{% endif %}, labelWidth: 150, - submit: function(){ - this.getForm().submit({ params: {serverid: {{MumbleServer.id}}, pk: this.pk } }); - }, + baseParams: {serverid: {{MumbleServer.id}} }, }, {% if MumbleAccount %} {% if IsAdmin %}