Skip to content

Commit 552404b

Browse files
committed
chore(python): fix restrictions after merge
1 parent ed01bfa commit 552404b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

templates/python/search_helpers.mustache

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,12 @@
209209
"""
210210
Helper: Generates a secured API key based on the given `parent_api_key` and given `restrictions`.
211211
"""
212-
if not isinstance(restrictions, SecuredApiKeyRestrictions):
213-
restrictions = SecuredApiKeyRestrictions.from_dict(restrictions)
212+
restrictions_dict = {}
213+
if isinstance(restrictions, SecuredApiKeyRestrictions):
214+
restrictions_dict = restrictions.to_dict()
215+
elif isinstance(restrictions, dict):
216+
restrictions_dict = restrictions
214217

215-
restrictions_dict: dict[str, Any] = restrictions.to_dict()
216218
if "searchParams" in restrictions_dict:
217219
restrictions_dict = {**restrictions_dict, **restrictions_dict["searchParams"]}
218220
del restrictions_dict["searchParams"]

0 commit comments

Comments
 (0)