Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix review state for received on submission table #2101

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/backend/app/submissions/submission_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ async def submission_table(
"and __system/submissionDate le {}T23:59:59.999+00:00"
).format(start_date, end_date)

if review_state:
if review_state and review_state != "received":
review_filter = f"__system/reviewState eq '{review_state}'"
filters["$filter"] = (
f"{filters['$filter']} and {review_filter}"
Expand All @@ -314,6 +314,12 @@ async def submission_table(
data = await submission_crud.get_submission_by_project(project, filters)
total_count = data.get("@odata.count", 0)
submissions = data.get("value", [])
if review_state == "received":
submissions = [
sub for sub in submissions if sub["__system"].get("reviewState") is None
]
total_count = len(submissions)

instance_ids = [
sub["__id"]
for sub in submissions
Expand Down
Loading