File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -193,15 +193,16 @@ def _credentials_auth(self):
193193 if not self .email or not self .password :
194194 raise GitlabAuthenticationError ("Missing email/password" )
195195
196+ data = {'email' : self .email , 'password' : self .password }
196197 if self .api_version == '3' :
197- data = json .dumps ({'email' : self .email , 'password' : self .password })
198- r = self ._raw_post ('/session' , data ,
198+ r = self ._raw_post ('/session' , json .dumps (data ),
199199 content_type = 'application/json' )
200200 raise_error_from_response (r , GitlabAuthenticationError , 201 )
201201 self .user = self ._objects .CurrentUser (self , r .json ())
202202 else :
203- manager = self ._objects .CurrentUserManager ()
204- self .user = manager .get (self .email , self .password )
203+ r = self .http_post ('/session' , data )
204+ manager = self ._objects .CurrentUserManager (self )
205+ self .user = self ._objects .CurrentUser (manager , r )
205206
206207 self ._set_token (self .user .private_token )
207208
You can’t perform that action at this time.
0 commit comments