From 6f5664346657754c75002df910efe983bdf7e89d Mon Sep 17 00:00:00 2001 From: nolan Date: Sat, 9 Dec 2023 23:04:39 -0800 Subject: [PATCH] update args style for voters get all --- lib_af_api/voter.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib_af_api/voter.py b/lib_af_api/voter.py index 205ae26..ea7890c 100644 --- a/lib_af_api/voter.py +++ b/lib_af_api/voter.py @@ -23,7 +23,7 @@ class Voter(): def get_all(self, args = None): """ - get Get the voter + get_all Get the voter :param args: Dict of args to add as URL params """ @@ -35,16 +35,13 @@ class Voter(): 'Authorization': f'Bearer {self.jwt}' } - url_args = "" - prefix = "" - if isinstance(args, dict): - for k in args: - url_args += f"{prefix}{k}={args[k]}" - prefix = "&" + if not isinstance(args, dict): + args = {} # Run the GET response = requests.get( - f'{self.base_url}/api/v1/voters?{url_args}', + f'{self.base_url}/api/v1/voters', + params=args, headers=headers, timeout=300 )