Updated README.md and tuned delete_inactives.py query
This commit is contained in:
pare
60a5be7b3d
commit
700ad081b4
S'han modificat 2 arxius amb 4 adicions i 6 eliminacions
|
@ -24,7 +24,7 @@ Within Python Virtual Environment:
|
|||
|
||||
4. Use your favourite scheduling method to set mailing.py to run regularly. Column 'elapsed_days' of mailing's database will be updated so you can decide actions after some time.
|
||||
|
||||
5. Run `python delete_inactives.py` to delete all inactive users after 30 days period from the warning email.
|
||||
5. Run `python delete_inactives.py` to delete all inactive users who replied yes to deletion and all the rest with no feedback after 31 days period from the warning email.
|
||||
|
||||
6. Run `python edit_status.py` to set True or False any of following `mailing_db_table` columns: `to_be_deleted`, `feedback` and `recipient_error`. Useful after emailed user's feedback.
|
||||
|
||||
|
|
|
@ -161,17 +161,15 @@ if __name__ == '__main__':
|
|||
|
||||
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'"
|
||||
query = "select account_id, username, email, to_be_deleted, feedback, recipient_error, elapsed_days from " + mailing_db_table + " where to_be_deleted and feedback"
|
||||
|
||||
delete_inactives(deletion_accepted, query)
|
||||
|
||||
###############################################################################
|
||||
# select and delete users who don't replied to email after 31 days
|
||||
# select and delete users who don't replied the 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 elapsed_days = '31'"
|
||||
query = "select account_id, username, email, to_be_deleted, feedback, recipient_error, elapsed_days from " + mailing_db_table + " where not feedback and elapsed_days = '31'"
|
||||
|
||||
delete_inactives(deletion_accepted, query)
|
||||
|
|
Loading…
Referencia en una nova incidència