return true if the id is not matched
This commit is contained in:
+10
-6
@@ -13,6 +13,7 @@ from src.db.mongo_manager import MONGO_STORE_MANAGER
|
||||
from src.logs.AppLogging import init_logger
|
||||
from src.mail.mail_constants import DOMAIN_HOTMAIL, create_imap
|
||||
from src.pojo.mail.mail_pojo import MailPojo, MailAddress
|
||||
from src.utils.excel_reader import ExcelHelper
|
||||
from src.utils.timeutiles import is_time_between
|
||||
|
||||
VALIDATION_URL_SUBJECT_fr = 'Validation de votre demande de rendez-vous'
|
||||
@@ -198,13 +199,15 @@ class MailReader():
|
||||
|
||||
|
||||
def need_to_valid_url(url: str, successful_items) -> bool:
|
||||
return True
|
||||
# return True
|
||||
if len(successful_items) == 0:
|
||||
return False
|
||||
print("url is :" + url)
|
||||
parts = url.split('/')
|
||||
id = parts[5]
|
||||
if len(id) == 6:
|
||||
if id == "CS93VB":
|
||||
print("found")
|
||||
for item in successful_items:
|
||||
if item.id == id:
|
||||
if item.url_validated is not None:
|
||||
@@ -212,8 +215,7 @@ def need_to_valid_url(url: str, successful_items) -> bool:
|
||||
else:
|
||||
# if url_validated is None
|
||||
return True
|
||||
# return True by default
|
||||
return False
|
||||
return True
|
||||
else:
|
||||
print("id not valid:{}".format(id))
|
||||
return False
|
||||
@@ -257,11 +259,13 @@ def read_mails():
|
||||
# check time before start checking emails
|
||||
if is_time_between(time(7, 30), time(19, 30)):
|
||||
# get email address
|
||||
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||
# mail_address1 = MailAddress(mail="appointment2022@aol.com", password="gyilpmvyyvlcaviq")
|
||||
# mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||
# excel_reader = ExcelHelper()
|
||||
# mail_list =excel_reader.read_email_pojo(file_name="/Users/lpan/Desktop/hotmail_list.xlsx")
|
||||
mail_address1 = MailAddress(mail="appointment2022@aol.com", password="gyilpmvyyvlcaviq")
|
||||
# mail_address1 = MailAddress(mail="chenpeijun@aol.com", password="ytifuwguknzifqyb")
|
||||
# # mail_address3 = MailAddress(mail="ciyuexie@aol.com", password="czezlmmyypokdfce")
|
||||
# mail_list = [mail_address1]
|
||||
mail_list = [mail_address1]
|
||||
successful_items = MONGO_STORE_MANAGER.get_all_successful_items_for_day()
|
||||
mails_messages = []
|
||||
with ThreadPoolExecutor(max_workers=200) as executor:
|
||||
|
||||
Reference in New Issue
Block a user