|
|
|
@ -157,23 +157,21 @@ if __name__ == '__main__':
|
|
|
|
|
rvm_ruby = os.environ['HOME'] + "/.rbenv/shims/ruby"
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
# select users who replied the warning email saying yes to deletion
|
|
|
|
|
###############################################################################
|
|
|
|
|
# select and delete users who replied the warning email saying yes to deletion
|
|
|
|
|
|
|
|
|
|
deletion_accepted = True
|
|
|
|
|
|
|
|
|
|
query = "select account_id, username, email, to_be_deleted, feedback, recipient_error, elapsed_days from " + mailing_db_table + " where to_be_deleted = 't' and "
|
|
|
|
|
query += "feedback = 't' and recipient_error = 'f' and emailed_at < now() - interval '31 days'"
|
|
|
|
|
query += "feedback = 't' and recipient_error = 'f'"
|
|
|
|
|
|
|
|
|
|
delete_inactives(deletion_accepted, query)
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
# select users who don't replied to email after 30 days
|
|
|
|
|
###############################################################################
|
|
|
|
|
# select and delete users who don't replied to email after 31 days
|
|
|
|
|
|
|
|
|
|
deletion_accepted = False
|
|
|
|
|
|
|
|
|
|
query = "select account_id, username, email, to_be_deleted, feedback, recipient_error, elapsed_days from " + mailing_db_table + " where to_be_deleted = 'f' and "
|
|
|
|
|
query += "feedback = 'f' and recipient_error = 'f' and emailed_at < now() - interval '31 days'"
|
|
|
|
|
query += "feedback = 'f' and recipient_error = 'f' and elapsed_days = '31'"
|
|
|
|
|
|
|
|
|
|
delete_inactives(deletion_accepted, query)
|
|
|
|
|