Merge branch 'mealie-next' into fix/translation-issues-when-scraping

This commit is contained in:
Michael Genson
2024-02-04 13:20:44 -06:00
committed by GitHub
183 changed files with 4530 additions and 2172 deletions

View File

@@ -3,6 +3,7 @@ This file contains code taken from fastapi-utils project. The code is licensed u
See their repository for details -> https://github.com/dmontagu/fastapi-utils
"""
import inspect
from collections.abc import Callable
from typing import Any, TypeVar, cast, get_type_hints

View File

@@ -34,7 +34,7 @@ class MealieCrudRoute(APIRoute):
with contextlib.suppress(JSONDecodeError):
response = await original_route_handler(request)
response_body = json.loads(response.body)
if type(response_body) == dict:
if isinstance(response_body, dict):
if last_modified := response_body.get("updateAt"):
response.headers["last-modified"] = last_modified

View File

@@ -67,7 +67,8 @@ def get_token(
if "," in ip: # if there are multiple IPs, the first one is canonically the true client
ip = str(ip.split(",")[0])
else:
ip = request.client.host
# request.client should never be null, except sometimes during testing
ip = request.client.host if request.client else "unknown"
try:
user = authenticate_user(session, email, password) # type: ignore