Browse Source

convert the default port to int and fix displaying the correct port in the admin

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
a7f0bb8da3
  1. 2
      pyweb/mumble/admin.py
  2. 4
      pyweb/mumble/models.py

2
pyweb/mumble/admin.py

@ -67,7 +67,7 @@ class MumbleAdmin(admin.ModelAdmin):
def get_port( self, obj ): def get_port( self, obj ):
if not obj.port: if not obj.port:
return "< %d >" % (settings.MUMBLE_DEFAULT_PORT + obj.srvid - 1)
return '< %d >' % (obj.server.defaultPort + obj.srvid - 1)
return obj.port return obj.port
get_port.short_description = _('Server Port') get_port.short_description = _('Server Port')

4
pyweb/mumble/models.py

@ -147,7 +147,7 @@ class MumbleServer( models.Model ):
def getDefaultPort( self ): def getDefaultPort( self ):
""" Return the default port configured on this server. """ """ Return the default port configured on this server. """
if "port" in self.defaultconf: if "port" in self.defaultconf:
return self.defaultconf['port']
return int(self.defaultconf['port'])
else: else:
return settings.MUMBLE_DEFAULT_PORT return settings.MUMBLE_DEFAULT_PORT
@ -162,7 +162,7 @@ class MumbleServer( models.Model ):
version = property( getVersion ) version = property( getVersion )
prettyversion = property( lambda self: '.'.join( map( str, self.version[:3] ) ), prettyversion = property( lambda self: '.'.join( map( str, self.version[:3] ) ),
doc="Pretty-Printed version" );
doc="Pretty-Printed version" )
class Mumble( models.Model ): class Mumble( models.Model ):

Loading…
Cancel
Save