Skip to content

Commit

Permalink
Unify approach from 0.17.x and central-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Bach committed Sep 2, 2019
1 parent 5161c9b commit bc367a0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions kalite/packages/bundled/securesync/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit bc367a0

Please sign in to comment.