Spaces:
Runtime error
Runtime error
CaesarCloudSync
commited on
Commit
·
b9171df
1
Parent(s):
1d6de29
RevisionBank Repalace Revision cards corrected
Browse files- __pycache__/csv_to_db.cpython-39.pyc +0 -0
- main.py +5 -2
- reacoverytest.py +5 -0
__pycache__/csv_to_db.cpython-39.pyc
ADDED
Binary file (1.43 kB). View file
|
|
main.py
CHANGED
@@ -291,11 +291,14 @@ async def changesendtoemail(data : JSONStructure = None, authorization: str = He
|
|
291 |
|
292 |
|
293 |
user_revision_cards = list(importcsv.db.accountrevisioncards.find({"email": current_user}))[0]
|
294 |
-
importcsv.db.accountrevisioncards.delete_many(user_revision_cards)
|
295 |
del user_revision_cards["sendtoemail"]
|
296 |
sendtoemail = data["sendtoemail"]
|
297 |
user_revision_cards.update({"sendtoemail": sendtoemail})
|
298 |
-
importcsv.db.accountrevisioncards.
|
|
|
|
|
|
|
299 |
return {"message": "Send to email changed."}
|
300 |
elif not email_exists:
|
301 |
return {"message":"email does not exist"}
|
|
|
291 |
|
292 |
|
293 |
user_revision_cards = list(importcsv.db.accountrevisioncards.find({"email": current_user}))[0]
|
294 |
+
#importcsv.db.accountrevisioncards.delete_many(user_revision_cards)
|
295 |
del user_revision_cards["sendtoemail"]
|
296 |
sendtoemail = data["sendtoemail"]
|
297 |
user_revision_cards.update({"sendtoemail": sendtoemail})
|
298 |
+
importcsv.db.accountrevisioncards.replace_one(
|
299 |
+
{"email":current_user},user_revision_cards
|
300 |
+
)
|
301 |
+
#importcsv.db.accountrevisioncards.insert_one(user_revision_cards)
|
302 |
return {"message": "Send to email changed."}
|
303 |
elif not email_exists:
|
304 |
return {"message":"email does not exist"}
|
reacoverytest.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from csv_to_db import ImportCSV
|
3 |
+
importcsv = ImportCSV("RevisionBankDB",maindb=0)
|
4 |
+
|
5 |
+
print(list(importcsv.db.oplog.rs.find()))
|