From f3269905918866a56ffef96a333d9896c4bc7cb0 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Tue, 23 Feb 2010 19:54:07 +0100 Subject: [PATCH] double check config fields, and substract -1 (server IDs start at 1) --- pyweb/mumble/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyweb/mumble/models.py b/pyweb/mumble/models.py index 47e0d3f..e5dd71e 100644 --- a/pyweb/mumble/models.py +++ b/pyweb/mumble/models.py @@ -235,9 +235,9 @@ class Mumble( models.Model ): else: self.name = conf["registername"]; - defaultport = settings.MUMBLE_DEFAULT_PORT + self.srvid + defaultport = settings.MUMBLE_DEFAULT_PORT + self.srvid - 1 - if "registerhostname" in conf: + if "registerhostname" in conf and conf["registerhostname"]: if ':' in conf["registerhostname"]: regname, regport = conf["registerhostname"].split(':') regport = int(regport) @@ -248,12 +248,12 @@ class Mumble( models.Model ): regname = None regport = defaultport - if "host" in conf: + if "host" in conf and conf["host"]: addr = conf["host"] else: addr = None - if "port" in conf: + if "port" in conf and conf["port"]: self.port = int(conf["port"]) else: self.port = defaultport