Fixed a mistake in checkConnection not checking the status_code
All checks were successful
Build python package / Build (push) Successful in 40s
All checks were successful
Build python package / Build (push) Successful in 40s
This commit is contained in:
@@ -38,7 +38,7 @@ class GLPIAPI:
|
|||||||
def CheckConnection(self):
|
def CheckConnection(self):
|
||||||
sessionUri = f"{self.Server}/apirest.php/getFullSession/"
|
sessionUri = f"{self.Server}/apirest.php/getFullSession/"
|
||||||
result = requests.get(sessionUri, headers=self.Headers)
|
result = requests.get(sessionUri, headers=self.Headers)
|
||||||
if(result != 200 and result.json()[0] == 'ERROR_SESSION_TOKEN_INVALID'):
|
if(result.status_code != 200 and result.json()[0] == 'ERROR_SESSION_TOKEN_INVALID'):
|
||||||
self.InitConnection()
|
self.InitConnection()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user