Skip to content

Commit

Permalink
add download method
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Dec 11, 2024
1 parent f790c29 commit bff6b05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions application/src/tira_app/endpoints/v1/_anonymous.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def download_anonymous_submission(request: Request, submission_uuid: str) -> Res
Returns:
Response: The uploaded data
"""
submission_uuid = secure_filename(submission_uuid)
submission_uuid = secure_filename(submission_uuid).replace(".zip", "")
try:
upload = modeldb.AnonymousUploads.objects.get(uuid=submission_uuid)
except:
Expand Down Expand Up @@ -154,6 +154,6 @@ def chunks(self):

endpoints = [
path("claim/<str:vm_id>/<str:submission_uuid>", claim_submission),
path("<str:submission_uuid>.zip", download_anonymous_submission),
path("<str:submission_uuid>", read_anonymous_submission),
path("download/<str:submission_uuid>", download_anonymous_submission),
]
2 changes: 1 addition & 1 deletion frontend/src/ClaimSubmission.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default {
link_chatnoir() { return chatNoirUrl(this.dataset) },
download_link() {
if (this.submissionToClaim && this.submissionToClaim.dataset_id && this.dataset) {
return this.rest_url + `/v1/anonymous/download/` + this.submissionToClaim.uuid
return this.rest_url + `/v1/anonymous/` + this.submissionToClaim.uuid + `.zip`
}
},
registered() { return this.vm_id && this.vm_id !== undefined && ('' + this.vm_id) !== 'undefined' && ('' + this.vm_id) !== 'null'},
Expand Down

0 comments on commit bff6b05

Please sign in to comment.