Skip to content

Commit

Permalink
improve purge email script logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bdzim committed Aug 19, 2020
1 parent 1a80b36 commit e9c1914
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/purge_users_by_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ def main():
if user['purgehold_active']:
log.info('Skipping user "%s" because purgehold is active', email)
else:
log.info('Purging user "%s"', email)
if not dry_run:
if dry_run:
log.info('Dry run - simulating purging user "%s"', email)
else:
try:
api.delete_user(email)
log.info('User "%s" has been purged', email)
except:
log.error('Error purging user "%s"', email)
log.info('User "%s" has been purged', email)


if __name__ == "__main__":
Expand Down

0 comments on commit e9c1914

Please sign in to comment.