Browse Source

include self explicitly in the decorator's definition, and recognize None as an empty password

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
a40fded75f
  1. 4
      pyweb/mumble/MumbleCtlIce.py
  2. 2
      pyweb/mumble/models.py

4
pyweb/mumble/MumbleCtlIce.py

@ -41,10 +41,10 @@ def protectDjangoErrPage( func ):
"""
@wraps(func)
def protection_wrapper( *args, **kwargs ):
def protection_wrapper( self, *args, **kwargs ):
""" Call the original function and catch Ice exceptions. """
try:
return func( *args, **kwargs );
return func( self, *args, **kwargs );
except Ice.Exception, err:
raise err;
protection_wrapper.innerfunc = func

2
pyweb/mumble/models.py

@ -229,7 +229,7 @@ class Mumble( models.Model ):
users_regged = property( lambda self: self.mumbleuser_set.count(), doc="Number of registered users." );
users_online = property( lambda self: len(self.ctl.getPlayers(self.srvid)), doc="Number of online users." );
channel_cnt = property( lambda self: len(self.ctl.getChannels(self.srvid)), doc="Number of channels." );
is_public = property( lambda self: self.passwd == '',
is_public = property( lambda self: not self.passwd,
doc="False if a password is needed to join this server." );
is_server = True;

Loading…
Cancel
Save