Browse Source

Fixed a bug that caused an Exception when Users tried to register a new Account in Murmur, instead of updating the old one

Natenom/support-murmur-13-1446181288462
root 16 years ago
parent
commit
2969d71598
  1. 6
      pyweb/mumble/views.py

6
pyweb/mumble/views.py

@ -110,7 +110,10 @@ def register( request, server ):
srv = Mumble.objects.get( id=server ); srv = Mumble.objects.get( id=server );
if request.user.is_authenticated(): if request.user.is_authenticated():
try:
reg = MumbleUser.objects.get( server=srv, owner=request.user ); reg = MumbleUser.objects.get( server=srv, owner=request.user );
except MumbleUser.DoesNotExist:
reg = None;
else: else:
reg = None; reg = None;
@ -126,7 +129,10 @@ def savereg( request ):
# raise Exception, "You need to be logged in to register yourself with Mumble."; # raise Exception, "You need to be logged in to register yourself with Mumble.";
srv = Mumble.objects.get( id=request.POST['id'] ); srv = Mumble.objects.get( id=request.POST['id'] );
try:
reg = MumbleUser.objects.get( server=srv, owner=request.user ); reg = MumbleUser.objects.get( server=srv, owner=request.user );
except MumbleUser.DoesNotExist:
reg = None;
if reg is None: if reg is None:
reg = MumbleUser( name=request.POST['username'], password=request.POST['password'], server=srv, owner=request.user ); reg = MumbleUser( name=request.POST['username'], password=request.POST['password'], server=srv, owner=request.user );

Loading…
Cancel
Save