Browse Source

remove save() method which doesn't exist in MumbleUserForm, which would cause problems when linking is disabled

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
92ddc5d57a
  1. 10
      pyweb/mumble/forms.py
  2. 4
      pyweb/mumble/views.py

10
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:
@ -141,15 +142,6 @@ class MumbleUserLinkForm( MumbleUserForm ):
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 ):
""" The form used to upload a new image to be set as texture. """

4
pyweb/mumble/views.py

@ -95,7 +95,6 @@ def show( request, server ):
unregged_user_form = MumbleUserForm;
if request.method == 'POST' and 'mode' in request.POST and request.POST['mode'] == 'reg':
try:
user = MumbleUser.objects.get( server=srv, owner=request.user );
@ -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), } ) );

Loading…
Cancel
Save