Skip to content

Commit

Permalink
Updated to v1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzyj123 authored Nov 8, 2024
1 parent cabcb84 commit f0fcc3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyclearpass/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,21 @@ def _remove_empty_keys(keys):
if keys[item] == "":
remove_empty_values_from_dict.append(item)
else:
# print(item,": ", keys[item])
pass
for removal in remove_empty_values_from_dict:
del keys[removal]
return keys


def _generate_parameterised_url(url, parameters=""):
parameters = _remove_empty_keys(keys=parameters)

if len(parameters) == 0:
return url
else:
for key, value in parameters.items():
if isinstance(value, dict):
parameters[key] = json.dumps(value, separators=(',', ':'), ensure_ascii=False)

encoded_url = urllib.parse.urlencode(parameters)
final_url = url + "?" + encoded_url
return final_url

0 comments on commit f0fcc3d

Please sign in to comment.