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 )