-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add incomplete upload dialog to DLP when unembargo is blocked #2082
base: master
Are you sure you want to change the base?
Conversation
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.
LGTM except one note about pagination
dandiapi/api/views/dandiset.py
Outdated
@swagger_auto_schema( | ||
methods=['GET'], | ||
manual_parameters=[DANDISET_PK_PARAM], | ||
request_body=no_body, | ||
operation_summary='List active/incomplete uploads in this dandiset.', | ||
) | ||
@action(methods=['GET'], detail=True) | ||
def uploads(self, request, dandiset__pk): | ||
dandiset: Dandiset = self.get_object() | ||
|
||
# Special case where a "safe" method is access restricted, due to the nature of uploads | ||
self.require_owner_perm(dandiset) | ||
|
||
uploads: QuerySet[Upload] = dandiset.uploads.all() | ||
serializer = DandisetUploadSerializer(instance=uploads, many=True) | ||
return Response(serializer.data, status=status.HTTP_200_OK) |
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.
I think we should paginate these. Someone could theoretically DoS the server by creating thousands of uploads (which may be a completely legitimate action) and then hitting this endpoint.
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.
Just pushed that change. It's a bit awkward since we can't use the default pagination behavior, due to this being a "detailed" endpoint that still needs pagination. That was originally the reason I didn't bother, since it seemed unlikely to be an issue anyway, but better safe than sorry. I've also changed the client to match that, and tested it locally, confirming the overall behavior is unchanged.
6ccaeb6
to
f1078bb
Compare
Recently we've had several instances of a dandiset unembargo being blocked by incomplete/active uploads. Most of the time, these uploads are junk and the owners simply wish to clear them, which requires admin intervention. This PR adds the API and Vue client support for users to list and delete these lingering uploads themselves.
Here is a video of the new UI.
dandi-unembargo-uploads-2024-11-21_14.18.53.mp4