mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
add env check before purging data in command
This commit is contained in:
@@ -113,6 +113,10 @@ def purge_functional_test_data(user_email_prefix):
|
||||
|
||||
users, services, etc. Give an email prefix. Probably "notify-tests-preview".
|
||||
"""
|
||||
if os.getenv('NOTIFY_ENVIRONMENT', '') not in ['development', 'test']:
|
||||
current_app.logger.error('Can only be run in development')
|
||||
return
|
||||
|
||||
users = User.query.filter(User.email_address.like("{}%".format(user_email_prefix))).all()
|
||||
for usr in users:
|
||||
# Make sure the full email includes a uuid in it
|
||||
|
||||
Reference in New Issue
Block a user