Skip to content

feat: allow bulk edit of verify and review #780

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StephanH90
Copy link
Contributor

Currently it's not possible to bulk edit any reports that have the "needs review" flag set. This MR addresses this and shows you a warning (and then the backend throws an error) if you try to save an invalid combination of verify and review.

image

image

Currently it's not possible to bulk edit any reports that have the "needs review" flag set.
This MR addresses this and shows you a warning (and then the backend throws an error) if you
try to save an invalid combination of verify and review.
@StephanH90 StephanH90 requested review from a team as code owners July 8, 2025 06:50
@StephanH90 StephanH90 self-assigned this Jul 8, 2025
@StephanH90 StephanH90 added feature This issue or pull request discusses a feature javascript Pull requests that update Javascript code python Pull requests that update Python code labels Jul 8, 2025
@StephanH90
Copy link
Contributor Author

@trowik I need to take a look at the failing test. I had a quick look right now but I didn't understand why the data attribute that is set in the test is not received by the ReportViewSet.

Copy link
Member

@winged winged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small perf suggestion

@@ -251,11 +251,24 @@ def bulk(self, request):

fields["verified_by"] = (verified and user) or None

if fields.get("review") or any(queryset.values_list("review", flat=True)):
if (
any(queryset.values_list("review", flat=True))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
any(queryset.values_list("review", flat=True))
queryset.filter(review=True).exists()

if (
verified is None
and fields.get("review")
and any(queryset.values_list("verified_by", flat=True))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and any(queryset.values_list("verified_by", flat=True))
and queryset.filter(verified_by__isnull=False).exists()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue or pull request discusses a feature javascript Pull requests that update Javascript code python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants