valid the links with paris ip
This commit is contained in:
+12
-1
@@ -20,6 +20,7 @@ EMAIL_LIST = "EMAIL_LIST"
|
||||
DESTINATION_EMAIL_LIST = "DESTINATION_EMAIL_LIST"
|
||||
LINKS_TO_VALIDATE = "LINKS_TO_VALIDATE"
|
||||
INVALID_EMAIL_LIST = "INVALID_EMAIL_LIST"
|
||||
CONTACT_LIST_SERIAL_MAP = "CONTACT_LIST_SERIAL_MAP"
|
||||
|
||||
|
||||
class MongoDbManager:
|
||||
@@ -75,6 +76,13 @@ class MongoDbManager:
|
||||
result_list.append(ContactPojo.from_firestore_dict(document))
|
||||
return result_list
|
||||
|
||||
def get_all_contact_serial_list(self) -> list:
|
||||
result_list = []
|
||||
cursor = self.db[CONTACT_LIST_SERIAL_MAP]
|
||||
for document in cursor.find():
|
||||
result_list.append(ContactPojo.from_firestore_dict(document))
|
||||
return result_list
|
||||
|
||||
def save_links_to_validate(self, link: str, mail_address: str, _all_contact_list: list):
|
||||
collection_to_use = self.db[LINKS_TO_VALIDATE]
|
||||
updated_at = time.strftime("%H:%M:%S", time.localtime())
|
||||
@@ -174,7 +182,10 @@ class MongoDbManager:
|
||||
validated_by = "Double"
|
||||
collection.find_one_and_update({'_id': _id}, {
|
||||
"$set": {"url_validated": state, "validated_at": validated_at, "id": _id, "email": linkPojo.email,
|
||||
"url": link, "validated_by_ua": ua,
|
||||
"url": link,
|
||||
"source_from": linkPojo.model,
|
||||
"serial": linkPojo.serial,
|
||||
"validated_by_ua": ua,
|
||||
"validated_by": validated_by}},
|
||||
upsert=True)
|
||||
# remove the link from db
|
||||
|
||||
Reference in New Issue
Block a user