Replaced find_one_and* with proper methods

This commit is contained in:
Profitroll 2024-03-11 21:37:01 +01:00
parent f8ec8f6335
commit bd43ee15ae
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
2 changed files with 2 additions and 6 deletions

View File

@ -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:

View File

@ -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