Browse Source

fix "new user" dialog being broken by getAdmin trying to access a not-yet-set ForeignKey.

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
62ffb43795
  1. 5
      pyweb/mumble/models.py

5
pyweb/mumble/models.py

@ -537,10 +537,15 @@ class MumbleUser( models.Model ):
# Admin handlers
def getAdmin( self ):
""" Get ACL of root Channel, get the admin group and see if this user is in it. """
if self.mumbleid == -1:
return False;
else:
return self.server.rootchan.acl.group_has_member( "admin", self.mumbleid );
def setAdmin( self, value ):
""" Set or revoke this user's membership in the admin group on the root channel. """
if self.mumbleid == -1:
return False;
if value:
self.server.rootchan.acl.group_add_member( "admin", self.mumbleid );
else:

Loading…
Cancel
Save