File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -146,20 +146,16 @@ 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 )
159-
160- else :
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+ if not any (login , password , self ._auth_session ):
154+ raise ClientError ("Unable to log in: no auth token provided for login" )
155+ if login and password :
156+ self ._auth_params = {"login" : login , "password" : password }
161157 if not self ._auth_session :
162- raise ClientError ( "Unable to log in: no auth token provided for login" )
158+ self . login ( login , password )
163159
164160 def setup_logging (self ):
165161 """Setup Mergin Maps client logging."""
You can’t perform that action at this time.
0 commit comments