Skip to content

Commit a7e22f4

Browse files
Pycognito fixes (qwigo#93)
* Pycognito fixes admin_create_user with additional_kwargs admin_reset_password typo fix * Black fixes passing black * Update __init__.py
1 parent ac62bb3 commit a7e22f4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pycognito/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,22 +576,31 @@ def admin_get_user(self, attr_map=None):
576576
)
577577

578578
def admin_create_user(
579-
self, username, temporary_password="", attr_map=None, **kwargs
579+
self,
580+
username,
581+
temporary_password="",
582+
additional_kwargs=None,
583+
attr_map=None,
584+
**kwargs,
580585
):
581586
"""
582587
Create a user using admin super privileges.
583588
:param username: User Pool username
584589
:param temporary_password: The temporary password to give the user.
585590
Leave blank to make Cognito generate a temporary password for the user.
591+
:param additional_kwargs: Dictionary with request params, such as MessageAction.
586592
:param attr_map: Attribute map to Cognito's attributes
587593
:param kwargs: Additional User Pool attributes
588594
:return response: Response from Cognito
589595
"""
596+
if additional_kwargs is None:
597+
additional_kwargs = {}
590598
response = self.client.admin_create_user(
591599
UserPoolId=self.user_pool_id,
592600
Username=username,
593601
UserAttributes=dict_to_cognito(kwargs, attr_map),
594602
TemporaryPassword=temporary_password,
603+
**additional_kwargs,
595604
)
596605
kwargs.update(username=username)
597606
self._set_attributes(response, kwargs)
@@ -656,7 +665,7 @@ def admin_reset_password(self, username, client_metadata=None):
656665
self.client.admin_reset_user_password(
657666
UserPoolId=self.user_pool_id,
658667
Username=username,
659-
ClientMetatada=client_metadata,
668+
ClientMetadata=client_metadata,
660669
)
661670

662671
def confirm_forgot_password(self, confirmation_code, password):

0 commit comments

Comments
 (0)