Skip to content
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

Ensure that _validate_file check is run #54

Merged
merged 1 commit into from
Oct 25, 2023
Merged

Conversation

vivekashok1221
Copy link
Member

@vivekashok1221 vivekashok1221 commented Oct 23, 2023

The check was at the wrong level of indentation and wouldn't have run on files as intended.

It is now at the correct level of indentation. Also, checking whether the filename is None has been moved inside _validate_file check.

@@ -37,9 +39,7 @@ def _validate_file(file: UploadFile) -> Literal[True]:

async def _upload_to_storage(files: list[UploadFile], destination: str) -> list[str]:
for file in files:
if file.filename is None:
raise HTTPException(status_code=400, detail="No filename provided.")
_validate_file(file)
Copy link
Contributor

Choose a reason for hiding this comment

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

lmaoo who even wrote this in the first place

@anand2312 anand2312 merged commit 339319d into main Oct 25, 2023
4 checks passed
@anand2312 anand2312 deleted the vivek/fix-indentation branch October 25, 2023 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants