overleaf-registration/container_to_container/tools/check_invites.py

14 lines
395 B
Python
Raw Normal View History

2024-07-17 11:59:31 +02:00
import pymongo
def check_invites(email_to_find: str,container_name:str = "overleafmongo", port: int = 27017) -> bool:
client = pymongo.MongoClient(container_name, port)
db = client.sharelatex
project_invites = db.projectInvites
search_result = project_invites.find_one({"email": email_to_find})
if search_result is None:
return False
else:
return True