Spaces:
Runtime error
Runtime error
CaesarCloudSync
commited on
Commit
·
6d70265
1
Parent(s):
b9171df
RevisionBank Repalace Revision cards corrected
Browse files
main.py
CHANGED
@@ -227,8 +227,11 @@ async def storeocrrevisioncards(data : JSONStructure = None, authorization: str
|
|
227 |
user_revision_cards["revisioncards"] = new_cards # Updates the list.
|
228 |
del user_revision_cards["_id"]
|
229 |
user_revision_cards["email"] = current_user # Sets the email to the current user.
|
230 |
-
importcsv.db.accountrevisioncards.delete_many({"email":current_user}) # Allows data to be updated.
|
231 |
-
importcsv.db.accountrevisioncards.insert_one(user_revision_cards) # Inserts the new data.
|
|
|
|
|
|
|
232 |
return {"message":"revision cards updated"}
|
233 |
elif cards_not_exist == []: # If the cards are already in the database, return a message.
|
234 |
return {"message":"No new cards"}
|
@@ -259,8 +262,9 @@ async def storerevisioncards(data : JSONStructure = None, authorization: str = H
|
|
259 |
user_revision_cards["revisioncards"] = new_cards # Updates the list.
|
260 |
del user_revision_cards["_id"]
|
261 |
user_revision_cards["email"] = current_user # Sets the email to the current user.
|
262 |
-
importcsv.db.accountrevisioncards.delete_many({"email":current_user}) # Allows data to be updated.
|
263 |
-
importcsv.db.accountrevisioncards.insert_one(user_revision_cards) # Inserts the new data.
|
|
|
264 |
return {"message":"revision cards updated"}
|
265 |
elif cards_not_exist == []: # If the cards are already in the database, return a message.
|
266 |
return {"message":"No new cards"}
|
@@ -296,8 +300,8 @@ async def changesendtoemail(data : JSONStructure = None, authorization: str = He
|
|
296 |
sendtoemail = data["sendtoemail"]
|
297 |
user_revision_cards.update({"sendtoemail": sendtoemail})
|
298 |
importcsv.db.accountrevisioncards.replace_one(
|
299 |
-
|
300 |
-
|
301 |
#importcsv.db.accountrevisioncards.insert_one(user_revision_cards)
|
302 |
return {"message": "Send to email changed."}
|
303 |
elif not email_exists:
|
|
|
227 |
user_revision_cards["revisioncards"] = new_cards # Updates the list.
|
228 |
del user_revision_cards["_id"]
|
229 |
user_revision_cards["email"] = current_user # Sets the email to the current user.
|
230 |
+
#importcsv.db.accountrevisioncards.delete_many({"email":current_user}) # Allows data to be updated.
|
231 |
+
#importcsv.db.accountrevisioncards.insert_one(user_revision_cards) # Inserts the new data.
|
232 |
+
importcsv.db.accountrevisioncards.replace_one(
|
233 |
+
{"email":current_user},user_revision_cards
|
234 |
+
)
|
235 |
return {"message":"revision cards updated"}
|
236 |
elif cards_not_exist == []: # If the cards are already in the database, return a message.
|
237 |
return {"message":"No new cards"}
|
|
|
262 |
user_revision_cards["revisioncards"] = new_cards # Updates the list.
|
263 |
del user_revision_cards["_id"]
|
264 |
user_revision_cards["email"] = current_user # Sets the email to the current user.
|
265 |
+
#importcsv.db.accountrevisioncards.delete_many({"email":current_user}) # Allows data to be updated.
|
266 |
+
#importcsv.db.accountrevisioncards.insert_one(user_revision_cards) # Inserts the new data.
|
267 |
+
|
268 |
return {"message":"revision cards updated"}
|
269 |
elif cards_not_exist == []: # If the cards are already in the database, return a message.
|
270 |
return {"message":"No new cards"}
|
|
|
300 |
sendtoemail = data["sendtoemail"]
|
301 |
user_revision_cards.update({"sendtoemail": sendtoemail})
|
302 |
importcsv.db.accountrevisioncards.replace_one(
|
303 |
+
{"email":current_user},user_revision_cards
|
304 |
+
)
|
305 |
#importcsv.db.accountrevisioncards.insert_one(user_revision_cards)
|
306 |
return {"message": "Send to email changed."}
|
307 |
elif not email_exists:
|