From 29d78f52cacc9c3ab14fadf2dc00986f6924ee85 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 12 Sep 2021 13:06:27 -0600 Subject: [PATCH] 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/ --- mealie/routes/deps.py | 2 +- mealie/routes/users/crud.py | 4 ++-- mealie/services/image/image.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mealie/routes/deps.py b/mealie/routes/deps.py index 1e9d9f07b065..df5d223ba3e2 100644 --- a/mealie/routes/deps.py +++ b/mealie/routes/deps.py @@ -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: diff --git a/mealie/routes/users/crud.py b/mealie/routes/users/crud.py index c7447003c022..55b4c4632e6a 100644 --- a/mealie/routes/users/crud.py +++ b/mealie/routes/users/crud.py @@ -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") diff --git a/mealie/services/image/image.py b/mealie/services/image/image.py index 5f0c4c294ffe..7cc35b771062 100644 --- a/mealie/services/image/image.py +++ b/mealie/services/image/image.py @@ -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]