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