overleaf/user_tools/does_user_exists.py
2024-04-09 20:09:22 +02:00

13 lines
315 B
Python

import pymongo
def does_user_exists(email_to_find: str) -> bool:
client = pymongo.MongoClient("overleafmongo", 27017)
db = client.sharelatex
users = db.users
search_result = users.find_one({"email": email_to_find})
if search_result is None:
return False
else:
return True