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. 2
      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 ); mUser = MumbleUser.objects.get( server=self.server, mumbleid=self.mumbleid );
except MumbleUser.DoesNotExist: except MumbleUser.DoesNotExist:
mUser = MumbleUser( server=self.server, name=self.cleaned_data['name'], mumbleid=self.mumbleid ); mUser = MumbleUser( server=self.server, name=self.cleaned_data['name'], mumbleid=self.mumbleid );
mUser.isAdmin = mUser.getAdmin();
mUser.save( dontConfigureMurmur=True ); mUser.save( dontConfigureMurmur=True );
if mUser.getAdmin() and not settings.ALLOW_ACCOUNT_LINKING_ADMINS: if mUser.getAdmin() and not settings.ALLOW_ACCOUNT_LINKING_ADMINS:
@ -141,15 +142,6 @@ class MumbleUserLinkForm( MumbleUserForm ):
return self.cleaned_data; 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 ): class MumbleTextureForm( Form ):
""" The form used to upload a new image to be set as texture. """ """ The form used to upload a new image to be set as texture. """

2
pyweb/mumble/views.py

@ -95,7 +95,6 @@ def show( request, server ):
unregged_user_form = MumbleUserForm; unregged_user_form = MumbleUserForm;
if request.method == 'POST' and 'mode' in request.POST and request.POST['mode'] == 'reg': if request.method == 'POST' and 'mode' in request.POST and request.POST['mode'] == 'reg':
try: try:
user = MumbleUser.objects.get( server=srv, owner=request.user ); user = MumbleUser.objects.get( server=srv, owner=request.user );
@ -105,6 +104,7 @@ def show( request, server ):
if regform.is_valid(): if regform.is_valid():
model = regform.save( commit=False ); 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. # If we're linking accounts, the change is local only.
model.save( dontConfigureMurmur=( "linkacc" in regform.data ) ); model.save( dontConfigureMurmur=( "linkacc" in regform.data ) );
return HttpResponseRedirect( reverse( show, kwargs={ 'server': int(server), } ) ); return HttpResponseRedirect( reverse( show, kwargs={ 'server': int(server), } ) );

Loading…
Cancel
Save