mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-05 16:41:24 -05:00
Merge branch 'mealie-next' into fix/translation-issues-when-scraping
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user