diff --git a/pyweb/mumble/forms.py b/pyweb/mumble/forms.py index 23fec7c..831cecb 100644 --- a/pyweb/mumble/forms.py +++ b/pyweb/mumble/forms.py @@ -133,6 +133,7 @@ class MumbleUserLinkForm( MumbleUserForm ): mUser = MumbleUser.objects.get( server=self.server, mumbleid=self.mumbleid ); except MumbleUser.DoesNotExist: mUser = MumbleUser( server=self.server, name=self.cleaned_data['name'], mumbleid=self.mumbleid ); + mUser.isAdmin = mUser.getAdmin(); mUser.save( dontConfigureMurmur=True ); if mUser.getAdmin() and not settings.ALLOW_ACCOUNT_LINKING_ADMINS: @@ -140,15 +141,6 @@ class MumbleUserLinkForm( MumbleUserForm ): self.instance = mUser; return self.cleaned_data; - - def save( self, *args, **kwargs ): - inst = MumbleUserForm.save( self, *args, **kwargs ); - - if 'linkacc' not in self.data: - inst.isAdmin = False; - inst.server = this.server; - - return inst; class MumbleTextureForm( Form ): diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index fa8ba24..7de2ae9 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -94,7 +94,6 @@ def show( request, server ): else: unregged_user_form = MumbleUserForm; - if request.method == 'POST' and 'mode' in request.POST and request.POST['mode'] == 'reg': try: @@ -104,7 +103,8 @@ def show( request, server ): regform.server = srv; if regform.is_valid(): model = regform.save( commit=False ); - model.owner = request.user; + model.owner = request.user; + model.server = srv; # If we're linking accounts, the change is local only. model.save( dontConfigureMurmur=( "linkacc" in regform.data ) ); return HttpResponseRedirect( reverse( show, kwargs={ 'server': int(server), } ) );