input messages updated
This commit is contained in:
pare
06f712fffd
commit
d11498f9f7
S'han modificat 1 arxius amb 6 adicions i 7 eliminacions
|
@ -1,7 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import pdb
|
|
||||||
from datetime import datetime, timezone, timedelta
|
from datetime import datetime, timezone, timedelta
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
|
@ -35,7 +34,7 @@ def ask_what_user():
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
def get_user(email):
|
def get_user(email):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
conn = psycopg2.connect(database = mailing_db, user = mailing_db_user, password = "", host = "/var/run/postgresql", port = "5432")
|
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))
|
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("\n")
|
||||||
print("Updating user " + str(id))
|
print("Updating user " + str(id))
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
cur.close()
|
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)
|
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':
|
if willdeleteit == 'f':
|
||||||
willdeleteit = 'False'
|
willdeleteit = 'False'
|
||||||
elif willdeleteit == 't':
|
elif willdeleteit == 't':
|
||||||
willdeleteit = 'True'
|
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':
|
if recip_error == 'f':
|
||||||
recip_error = 'False'
|
recip_error = 'False'
|
||||||
elif recip_error == 't':
|
elif recip_error == 't':
|
||||||
recip_error = 'True'
|
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':
|
if user_feed == 'f':
|
||||||
user_feed = 'False'
|
user_feed = 'False'
|
||||||
elif user_feed == 't':
|
elif user_feed == 't':
|
||||||
user_feed = 'True'
|
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)
|
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)
|
print_user(user_id, user_name, user_email, emailed_at, deleted, elapsed_days, to_be_deleted, recipient_error, user_feedback)
|
||||||
|
|
Loading…
Referencia en una nova incidència