Replaced find_one_and* with proper methods
This commit is contained in:
parent
f8ec8f6335
commit
bd43ee15ae
@ -226,9 +226,7 @@ class PyroClient(PyroClient):
|
||||
)
|
||||
raise SubmissionDuplicatesError(str(filepath), duplicates)
|
||||
|
||||
await col_submitted.find_one_and_update(
|
||||
{"_id": ObjectId(id)}, {"$set": {"done": True}}
|
||||
)
|
||||
await col_submitted.update_one({"_id": ObjectId(id)}, {"$set": {"done": True}})
|
||||
|
||||
try:
|
||||
if db_entry["temp"]["uuid"] is not None:
|
||||
|
@ -127,9 +127,7 @@ async def callback_query_no(app: PyroClient, callback: CallbackQuery):
|
||||
user = await app.find_user(callback.from_user)
|
||||
fullcallback = str(callback.data).split("_")
|
||||
|
||||
db_entry = await col_submitted.find_one_and_delete(
|
||||
{"_id": ObjectId(fullcallback[2])}
|
||||
)
|
||||
db_entry = await col_submitted.delete_one({"_id": ObjectId(fullcallback[2])})
|
||||
|
||||
if (
|
||||
db_entry["temp"]["uuid"] is not None
|
||||
|
Reference in New Issue
Block a user