File tree 1 file changed +5
-4
lines changed
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):
193
193
if not self .email or not self .password :
194
194
raise GitlabAuthenticationError ("Missing email/password" )
195
195
196
+ data = {'email' : self .email , 'password' : self .password }
196
197
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 ),
199
199
content_type = 'application/json' )
200
200
raise_error_from_response (r , GitlabAuthenticationError , 201 )
201
201
self .user = self ._objects .CurrentUser (self , r .json ())
202
202
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 )
205
206
206
207
self ._set_token (self .user .private_token )
207
208
You can’t perform that action at this time.
0 commit comments