Skip to content

Commit

Permalink
Bugfix #59: Use correct API version
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Schöchlin committed May 29, 2023
1 parent 02412a9 commit bcb898d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/zabbixconn.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ def update_media(self, user: str, description: str, sendto: str, media_opt: list
if unwanted_attrib in media_defaults:
del media_defaults[unwanted_attrib]

if self.get_api_minor_version() > 3.2:
if self.get_api_minor_version() > 5.2:
result = self.conn.user.update(userid=str(userid), medias=[media_defaults])
elif self.get_api_minor_version() > 3.2:
result = self.conn.user.update(userid=str(userid), user_medias=[media_defaults])
else:
self.delete_media_by_description(user, description)
Expand Down

0 comments on commit bcb898d

Please sign in to comment.