Skip to content

Commit 6eb9cd0

Browse files
FIX: make ik-attachment option handle True boolean value
1 parent 23c9c46 commit 6eb9cd0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

imagekitio/url.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ def __init__(self, request_obj):
2323

2424
def generate_url(self, options: Dict = None) -> str:
2525
options = camel_dict_to_snake_dict(options)
26-
if "query_parameters" in options.keys() and "ik-attachment" in options["query_parameters"].keys():
27-
options["query_parameters"]["ik-attachment"] = str(options["query_parameters"]["ik-attachment"]).lower()
26+
attachment = options.get("query_parameters",{}).get("ik-attachment")
27+
if attachment:
28+
options["query_parameters"]["ik-attachment"] = str(attachment).lower()
2829
extended_options = self.request.extend_url_options(options)
2930
return self.build_url(extended_options)
3031

0 commit comments

Comments
 (0)