diff --git a/kalite/packages/bundled/securesync/api_client.py b/kalite/packages/bundled/securesync/api_client.py index f06c7e5d36..9608f19bbf 100644 --- a/kalite/packages/bundled/securesync/api_client.py +++ b/kalite/packages/bundled/securesync/api_client.py @@ -14,8 +14,16 @@ class BaseClient(object): def __init__(self, host=None, require_trusted=True, verbose=True): - self.url = host or settings.CENTRAL_SERVER_URL - self.parsed_url = urllib2.urlparse.urlparse(self.url) + + if not host: + if settings.CENTRAL_SERVER_URL: + self.url = settings.CENTRAL_SERVER_URL + else: + self.url = "%s://%s/" % (settings.SECURESYNC_PROTOCOL, settings.CENTRAL_SERVER_HOST) + else: + parsed_url = urllib2.urlparse.urlparse(host) + self.url = "%s://%s" % (self.parsed_url.scheme, self.parsed_url.netloc) + self.require_trusted = require_trusted self.verbose = verbose