mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
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:
parent
006d6a6f1d
commit
29d78f52ca
@ -109,7 +109,7 @@ def validate_file_token(token: Optional[str] = None) -> Path:
|
|||||||
|
|
||||||
|
|
||||||
async def temporary_zip_path() -> 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")
|
temp_path = app_dirs.TEMP_DIR.joinpath("my_zip_archive.zip")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -104,8 +104,8 @@ async def get_user_image(id: str):
|
|||||||
user_dir = app_dirs.USER_DIR.joinpath(id)
|
user_dir = app_dirs.USER_DIR.joinpath(id)
|
||||||
for recipe_image in user_dir.glob("profile_image.*"):
|
for recipe_image in user_dir.glob("profile_image.*"):
|
||||||
return FileResponse(recipe_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")
|
@user_router.post("/{id}/image")
|
||||||
|
@ -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:
|
def scrape_image(image_url: str, slug: str) -> Path:
|
||||||
logger.info(f"Image URL: {image_url}")
|
logger.info(f"Image URL: {image_url}")
|
||||||
if isinstance(image_url, str): # Handles String Types
|
if isinstance(image_url, str): # Handles String Types
|
||||||
image_url = image_url
|
pass
|
||||||
|
|
||||||
if isinstance(image_url, list): # Handles List Types
|
if isinstance(image_url, list): # Handles List Types
|
||||||
image_url = image_url[0]
|
image_url = image_url[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user