Merge pull request #1883 from georgealton/raise_user_not_found_error
Missing users now raise a UserNotFoundException
This commit is contained in:
commit
c09b91de71
2 changed files with 19 additions and 3 deletions
|
|
@ -383,7 +383,7 @@ class CognitoIdpBackend(BaseBackend):
|
|||
raise ResourceNotFoundError(user_pool_id)
|
||||
|
||||
if username not in user_pool.users:
|
||||
raise ResourceNotFoundError(username)
|
||||
raise UserNotFoundError(username)
|
||||
|
||||
return user_pool.users[username]
|
||||
|
||||
|
|
@ -408,7 +408,7 @@ class CognitoIdpBackend(BaseBackend):
|
|||
raise ResourceNotFoundError(user_pool_id)
|
||||
|
||||
if username not in user_pool.users:
|
||||
raise ResourceNotFoundError(username)
|
||||
raise UserNotFoundError(username)
|
||||
|
||||
del user_pool.users[username]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue