Skip to content

Commit fb92640

Browse files
Fixing tests
1 parent 312567e commit fb92640

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws_lambda_powertools/utilities/data_classes/cognito_user_pool_event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def group_configuration(self) -> GroupOverrideDetails:
474474
@property
475475
def user_attributes(self) -> Dict[str, str]:
476476
"""One or more name-value pairs representing user attributes."""
477-
return self["request"]["userAttributes"]
477+
return self["request"].get("userAttributes") or {}
478478

479479
@property
480480
def client_metadata(self) -> Optional[Dict[str, str]]:
@@ -1062,7 +1062,7 @@ def code(self) -> str:
10621062
@property
10631063
def user_attributes(self) -> Dict[str, str]:
10641064
"""One or more name-value pairs representing user attributes. The attribute names are the keys."""
1065-
return self["request"]["userAttributes"]
1065+
return self["request"].get("userAttributes") or {}
10661066

10671067
@property
10681068
def client_metadata(self) -> Dict[str, str]:

0 commit comments

Comments
 (0)