From 02bee714b563fb68273d0c00599e11ef4121d1c7 Mon Sep 17 00:00:00 2001 From: Jason Secula Date: Wed, 18 Mar 2026 20:22:56 +0100 Subject: [PATCH] Updated UpdateUser to UpdateItemUser and added a parameter to set itemType --- GLPIAPI.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GLPIAPI.py b/GLPIAPI.py index 173da38..831103a 100644 --- a/GLPIAPI.py +++ b/GLPIAPI.py @@ -207,15 +207,15 @@ class GLPIAPI: uri = f"{self.Server}/apirest.php/Computer/" return requests.put(uri, headers=self.Headers, json=body) - def UpdateUser(self, deviceid, username): + def UpdateItemUser(self, itemID, itemType, username): body = { "input" : { - "id" : deviceid, + "id" : itemID, "users_id" : username } } - uri = f"{self.Server}/apirest.php/Computer/" + uri = f"{self.Server}/apirest.php/itemType/" return requests.put(uri, headers=self.Headers, json=body) def SetCustomField(self, itemType, containerName, containerID, itemId, fieldName, data):