Merge pull request #1883 from georgealton/raise_user_not_found_error

Missing users now raise a UserNotFoundException
This commit is contained in:
Steve Pulec 2018-10-17 23:49:22 -04:00 committed by GitHub
commit c09b91de71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View file

@ -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]