address LGTM errors and warnings (#676)

* remove assignment to itself, identified by LGTM: https://lgtm.com/rules/1800093/

* variable overwritten, identified by LGTM: https://lgtm.com/rules/1800095/

* unnecessary else, identified by LGTM: https://lgtm.com/rules/5980098/
This commit is contained in:
Patrick 2021-09-12 13:06:27 -06:00 committed by GitHub
parent 006d6a6f1d
commit 29d78f52ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ def validate_file_token(token: Optional[str] = None) -> Path:
async def temporary_zip_path() -> Path:
temp_path = app_dirs.TEMP_DIR.mkdir(exist_ok=True, parents=True)
app_dirs.TEMP_DIR.mkdir(exist_ok=True, parents=True)
temp_path = app_dirs.TEMP_DIR.joinpath("my_zip_archive.zip")
try:

View File

@ -104,8 +104,8 @@ async def get_user_image(id: str):
user_dir = app_dirs.USER_DIR.joinpath(id)
for recipe_image in user_dir.glob("profile_image.*"):
return FileResponse(recipe_image)
else:
raise HTTPException(status.HTTP_404_NOT_FOUND)
raise HTTPException(status.HTTP_404_NOT_FOUND)
@user_router.post("/{id}/image")

View File

@ -44,7 +44,7 @@ def write_image(recipe_slug: str, file_data: bytes, extension: str) -> Path:
def scrape_image(image_url: str, slug: str) -> Path:
logger.info(f"Image URL: {image_url}")
if isinstance(image_url, str): # Handles String Types
image_url = image_url
pass
if isinstance(image_url, list): # Handles List Types
image_url = image_url[0]