Keep pending field and price reviews accessible across report dates
This commit is contained in:
1 parent
f46efd6d9a
commit
52e5d7433b
11 files changed
+325
-26
No files matched your search
+6
-2
@@ -362,14 +362,18 @@ class PortalApplication:
|
||||
),
|
||||
)
|
||||
if method == "GET" and route.path == "/api/arr-downloads":
|
||||
pending_reader = getattr(self._arr_downloads, "pending_reviews",
|
||||
getattr(self._arr_downloads, "pending_data_reviews", lambda: []))
|
||||
pending = [self._arr_download_snapshot(task) for task in pending_reader()]
|
||||
pending = [task for task in pending if task and task.get("status") in {"needs_data_review", "needs_review"}]
|
||||
return Response.json(200, success({
|
||||
"ready": self._arr_downloads.ready,
|
||||
"context_id": getattr(self._arr_downloads, "context_id", None),
|
||||
"default_date": default_report_date(),
|
||||
"business_time_zone": "Asia/Bangkok",
|
||||
"latest_task": self._arr_download_snapshot(self._arr_downloads.latest()),
|
||||
"pending_data_reviews": [self._arr_download_snapshot(task) for task in
|
||||
getattr(self._arr_downloads, "pending_data_reviews", lambda: [])()],
|
||||
"pending_reviews": pending,
|
||||
"pending_data_reviews": [task for task in pending if task["status"] == "needs_data_review"],
|
||||
}))
|
||||
if method == "POST" and route.path == "/api/arr-downloads":
|
||||
self._require_csrf(normalized_headers)
|
||||
|
||||
Reference in new issue
Block a user