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)
|
raise SubmissionDuplicatesError(str(filepath), duplicates)
|
||||||
|
|
||||||
await col_submitted.find_one_and_update(
|
await col_submitted.update_one({"_id": ObjectId(id)}, {"$set": {"done": True}})
|
||||||
{"_id": ObjectId(id)}, {"$set": {"done": True}}
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if db_entry["temp"]["uuid"] is not None:
|
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)
|
user = await app.find_user(callback.from_user)
|
||||||
fullcallback = str(callback.data).split("_")
|
fullcallback = str(callback.data).split("_")
|
||||||
|
|
||||||
db_entry = await col_submitted.find_one_and_delete(
|
db_entry = await col_submitted.delete_one({"_id": ObjectId(fullcallback[2])})
|
||||||
{"_id": ObjectId(fullcallback[2])}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
db_entry["temp"]["uuid"] is not None
|
db_entry["temp"]["uuid"] is not None
|
||||||
|
Reference in New Issue
Block a user