From 66c5bfc1c61df8b700148465dee43e1ca2e24219 Mon Sep 17 00:00:00 2001 From: Jackson Chen Date: Thu, 14 Sep 2023 19:59:38 +0200 Subject: [PATCH] fix the rest of user_list missing admin arg fixes #127 --- synadm/api.py | 6 +++--- synadm/cli/notice.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/synadm/api.py b/synadm/api.py index e906da85..a47863e2 100644 --- a/synadm/api.py +++ b/synadm/api.py @@ -468,7 +468,7 @@ def user_list_paginate(self, _limit, _guests, _deactivated, """ while _from is not None: response = self.user_list(_from, _limit, _guests, _deactivated, - _name, _user_id) + _name, _user_id, None) yield response _from = response.get("next_token", None) @@ -1345,7 +1345,7 @@ def notice_send(self, receivers, content_plain, content_html, paginate, # A regular expression was supplied to match receivers. if regex: outputs = [] - response = self.user_list(0, paginate, True, False, "", "") + response = self.user_list(0, paginate, True, False, "", "", None) if "users" not in response: return while True: @@ -1361,7 +1361,7 @@ def notice_send(self, receivers, content_plain, content_html, paginate, if "next_token" not in response: return outputs response = self.user_list(response["next_token"], - 100, True, False, "", "") + 100, True, False, "", "", None) # Only a single user ID was supplied as receiver else: data["user_id"] = receivers diff --git a/synadm/cli/notice.py b/synadm/cli/notice.py index 3e6cf2c5..a94bef3d 100644 --- a/synadm/cli/notice.py +++ b/synadm/cli/notice.py @@ -135,7 +135,8 @@ def confirm_prompt(): formatted_content = formatted if formatted else plain_content if regex: - if "users" not in helper.api.user_list(0, 100, True, False, "", ""): + if "users" not in helper.api.user_list(0, 100, True, False, "", "", + None): return if not confirm_prompt(): return