mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
OP-2427 - refactor code
This commit is contained in:
parent
3ab8a5a11a
commit
dd1c0b18df
1 changed files with 3 additions and 9 deletions
|
|
@ -372,17 +372,11 @@ class BatchReprocessEndpoint(_RestApiEndpoint):
|
|||
async def post(self, batch_id) -> Response:
|
||||
batches = self.dbcon.find({"batch_id": batch_id,
|
||||
"status": "error"}).sort("_id", -1)
|
||||
batch = None
|
||||
if batches:
|
||||
batch = batches[0]
|
||||
|
||||
if batch:
|
||||
if batches:
|
||||
self.dbcon.update_one(
|
||||
{"_id": batch["_id"]},
|
||||
{"$set":
|
||||
{
|
||||
"status": "reprocess"
|
||||
}}
|
||||
{"_id": batches[0]["_id"]},
|
||||
{"$set": {"status": "reprocess"}}
|
||||
)
|
||||
output = [{"msg": "Batch id {} set to reprocess".format(batch_id)}]
|
||||
status = 200
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue