Correction bug 2
This commit is contained in:
@ -47,7 +47,7 @@ class GLPIAPI:
|
||||
|
||||
searchUri = f"{self.Server}/apirest.php/search/Computer?{search_parameter}"
|
||||
search = requests.get(searchUri, headers=self.Headers)
|
||||
print(search.status_code)
|
||||
|
||||
if(search.status_code == 200):
|
||||
search = search.json()
|
||||
if(search["totalcount"] == 1):
|
||||
@ -58,9 +58,8 @@ class GLPIAPI:
|
||||
elif(search["totalcount"] > 1):
|
||||
deviceID = list(search["data"].keys())
|
||||
return deviceID, search["data"], search["totalcount"]
|
||||
else:
|
||||
return "", "", 0
|
||||
return "", "", 0
|
||||
|
||||
return None, None, 0
|
||||
|
||||
def GetUser(self, username=None, email=None):
|
||||
|
||||
@ -80,8 +79,8 @@ class GLPIAPI:
|
||||
elif(search["totalcount"] > 1):
|
||||
userID = list(search["data"].keys())
|
||||
return userID, search["data"], search["totalcount"]
|
||||
else:
|
||||
return "", "", 0
|
||||
|
||||
return None, None, 0
|
||||
|
||||
def UpdateInventory(self, inventory):
|
||||
headers = {
|
||||
|
||||
Reference in New Issue
Block a user