input messages updated

master
spla 3 years ago
parent 06f712fffd
commit d11498f9f7

@ -1,7 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pdb
from datetime import datetime, timezone, timedelta
import time
import threading
@ -35,7 +34,7 @@ def ask_what_user():
###############################################################################
def get_user(email):
try:
conn = psycopg2.connect(database = mailing_db, user = mailing_db_user, password = "", host = "/var/run/postgresql", port = "5432")
@ -86,7 +85,7 @@ def update_user(will_be_deleted, recip_error, user_feedback, id):
cur.execute("UPDATE " + mailing_db_table + " SET to_be_deleted=(%s), recipient_error=(%s), feedback=(%s) where account_id=(%s)", (will_be_deleted, recip_error, user_feedback, id))
print("\n")
print("Updating user " + str(id))
conn.commit()
cur.close()
@ -155,24 +154,24 @@ while True:
print_user(user_id, user_name, user_email, emailed_at, deleted, elapsed_days, to_be_deleted, recipient_error, user_feedback)
willdeleteit = input("Do you want to mark user to be deleted? (True or False) ")
willdeleteit = input("Do you want to mark user to be deleted? (press t for True or f for False) ")
if willdeleteit == 'f':
willdeleteit = 'False'
elif willdeleteit == 't':
willdeleteit = 'True'
recip_error = input("Was the email refused? (True or False) ")
recip_error = input("Was the email refused? (press t for True or f for False) ")
if recip_error == 'f':
recip_error = 'False'
elif recip_error == 't':
recip_error = 'True'
user_feed = input("Have the user replied? (True or False) ")
user_feed = input("Have the user replied? (press t for True or f for False) ")
if user_feed == 'f':
user_feed = 'False'
elif user_feed == 't':
user_feed = 'True'
update_user(willdeleteit, recip_error, user_feed, user_id)
update_user(willdeleteit, recip_error, user_feed, user_id)
user_id, user_name, user_email, emailed_at, deleted, elapsed_days, to_be_deleted, recipient_error, user_feedback = get_user(user_email)
print_user(user_id, user_name, user_email, emailed_at, deleted, elapsed_days, to_be_deleted, recipient_error, user_feedback)

Loading…
Cancel
Save