mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-22 10:49:59 +00:00
This commit is contained in:
@@ -177,7 +177,12 @@ def normalize_ctx_input(T: type) -> callable:
|
|||||||
|
|
||||||
def decorator(func: callable):
|
def decorator(func: callable):
|
||||||
# conserve annotations for frappe.utils.typing_validations
|
# conserve annotations for frappe.utils.typing_validations
|
||||||
@functools.wraps(func, assigned=(a for a in functools.WRAPPER_ASSIGNMENTS if a != "__annotations__"))
|
@functools.wraps(
|
||||||
|
func,
|
||||||
|
assigned=(
|
||||||
|
a for a in functools.WRAPPER_ASSIGNMENTS if a not in ("__annotations__", "__annotate__")
|
||||||
|
),
|
||||||
|
)
|
||||||
def wrapper(ctx: T | Document | dict | str, *args, **kwargs):
|
def wrapper(ctx: T | Document | dict | str, *args, **kwargs):
|
||||||
if isinstance(ctx, Document):
|
if isinstance(ctx, Document):
|
||||||
ctx = T(**ctx.as_dict())
|
ctx = T(**ctx.as_dict())
|
||||||
|
|||||||
Reference in New Issue
Block a user