-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: main
Are you sure you want to change the base?
Conversation
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.
@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 |
There was a problem hiding this 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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and any(queryset.values_list("verified_by", flat=True)) | |
and queryset.filter(verified_by__isnull=False).exists() |
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.