Revert "revert: revert human input relevant code (#31766)"

This reverts commit 90fe9abab7.
This commit is contained in:
QuantumGhost
2026-02-01 16:13:36 +08:00
parent 7828508b30
commit 8ca020e179
470 changed files with 32468 additions and 2053 deletions

View File

@ -1,12 +1,15 @@
import contextvars
from collections.abc import Iterator
from contextlib import contextmanager
from typing import TypeVar
from typing import TYPE_CHECKING, TypeVar
from flask import Flask, g
T = TypeVar("T")
if TYPE_CHECKING:
from models import Account, EndUser
@contextmanager
def preserve_flask_contexts(
@ -64,3 +67,7 @@ def preserve_flask_contexts(
finally:
# Any cleanup can be added here if needed
pass
def set_login_user(user: "Account | EndUser"):
g._login_user = user