Skip to content

Commit

Permalink
fix unwanted parsing effect (#3371)
Browse files Browse the repository at this point in the history
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
  • Loading branch information
chloedia authored Oct 14, 2024
1 parent 5fc349c commit ee94257
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,25 @@ async def upload_file(
message = f"Brain will exceed maximum capacity. Maximum file allowed is : {convert_bytes(remaining_free_space)}"
raise HTTPException(status_code=403, detail=message)

file_name = sanitize_filename(str(uploadFile.filename))

# TODO: Later
upload_notification = notification_service.add_notification(
CreateNotification(
user_id=current_user.id,
bulk_id=bulk_id,
status=NotificationsStatusEnum.INFO,
title=f"{uploadFile.filename}",
title=file_name,
category="upload",
brain_id=str(brain_id),
)
)
file_name = f"{str(uploadFile.filename).split('.')[0]}.{str(uploadFile.filename).split('.')[-1]}"

background_tasks.add_task(
maybe_send_telemetry, "upload_file", {"file_name": file_name}
)

filename_with_brain_id = str(brain_id) + "/" + file_name
filename_with_brain_id = sanitize_filename(filename_with_brain_id)

buff_reader = io.BufferedReader(uploadFile.file) # type: ignore
try:
Expand Down

0 comments on commit ee94257

Please sign in to comment.