Skip to content

Commit

Permalink
Merge pull request #16 from willirath/patch-1
Browse files Browse the repository at this point in the history
Catch deletion of users that have not logged in
  • Loading branch information
yuvipanda authored Jan 17, 2019
2 parents 9c8545d + db02d3e commit 6e63073
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions firstuseauthenticator/firstuseauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ def delete_user(self, user):
This lets passwords be reset by deleting users.
"""
with dbm.open(self.dbm_path, 'c', 0o600) as db:
del db[user.name]
try:
with dbm.open(self.dbm_path, 'c', 0o600) as db:
del db[user.name]
except KeyError as k:
pass

def reset_password(self, username, new_password):
"""
Expand Down

0 comments on commit 6e63073

Please sign in to comment.