Skip to content

Commit 33a3371

Browse files
committed
fix: coverage by returning once
1 parent 1e0660e commit 33a3371

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

easypost/user.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,20 @@ def all_api_keys(cls, api_key: Optional[str] = None) -> Dict[str, Any]:
6161
def api_keys(self) -> List[ApiKey]:
6262
"""Retrieve a list of API keys (works for the authenticated user or a child user)."""
6363
api_keys = self.all_api_keys()
64+
my_api_keys = []
6465

6566
if api_keys["id"] == self.id:
6667
# This function was called on the authenticated user
67-
return api_keys["keys"]
68+
my_api_keys = api_keys["keys"]
6869
else:
6970
# This function was called on a child user (authenticated as parent, only return
7071
# this child user's details).
7172
for child in api_keys["children"]:
7273
if child.id == self.id:
73-
return child.keys
74+
my_api_keys = child.keys
75+
break
7476

75-
return []
77+
return my_api_keys
7678

7779
def update_brand(self, api_key: Optional[str] = None, **params) -> "User":
7880
"""Update the User's Brand."""

0 commit comments

Comments
 (0)