Create components/checkaccountexists.py
Browse files
components/checkaccountexists.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from component.mongoconnection import provideClient
|
| 2 |
+
|
| 3 |
+
mc=provideClient()
|
| 4 |
+
|
| 5 |
+
db=mc["askmydoc_db"]
|
| 6 |
+
coll=db["askmydoc_col"]
|
| 7 |
+
|
| 8 |
+
def checkAccount(owner):
|
| 9 |
+
document=coll.find_one({"owner":owner})
|
| 10 |
+
if document:
|
| 11 |
+
return True
|
| 12 |
+
else:
|
| 13 |
+
return False
|