Skip to content

Commit 5158610

Browse files
committed
simplify
1 parent 84ca917 commit 5158610

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

mergin/client.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,15 @@ def __init__(
146146
self.opener = urllib.request.build_opener(*handlers, https_handler)
147147
urllib.request.install_opener(self.opener)
148148

149-
if login or password:
150-
if login and not password:
151-
raise ClientError("Unable to log in: no password provided for '{}'".format(login))
152-
if password and not login:
153-
raise ClientError("Unable to log in: password provided but no username/email")
154-
155-
if login and password:
156-
self._auth_params = {"login": login, "password": password}
157-
if not self._auth_session:
158-
self.login(login, password)
149+
if login and not password:
150+
raise ClientError("Unable to log in: no password provided for '{}'".format(login))
151+
if password and not login:
152+
raise ClientError("Unable to log in: password provided but no username/email")
153+
154+
if login and password:
155+
self._auth_params = {"login": login, "password": password}
156+
if not self._auth_session:
157+
self.login(login, password)
159158

160159
def setup_logging(self):
161160
"""Setup Mergin Maps client logging."""

0 commit comments

Comments
 (0)