Delete inactives who replied yes to deletion

This commit is contained in:
spla 2022-08-02 07:15:00 +02:00
pare e6ae2104a4
commit 8710dee852

Veure arxiu

@ -157,23 +157,21 @@ if __name__ == '__main__':
rvm_ruby = os.environ['HOME'] + "/.rbenv/shims/ruby" 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 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 = "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) 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 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 = "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) delete_inactives(deletion_accepted, query)