Skip to content

Commit 61c19df

Browse files
committed
perf: 允许exclude中包含__all__字段
1 parent 652dcbb commit 61c19df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fastapi_user_auth/admin/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ def get_schema_fields_name_label(
7070
exclude_required: bool = False,
7171
exclude: Sequence[str] = None,
7272
) -> Dict[str, str]:
73-
"""获取schema字段名和标签"""
73+
"""获取schema字段名和标签.如果exclude中包含__all__,则返回空字典."""
7474
if not schema:
7575
return {}
76+
if exclude and "__all__" in exclude:
77+
return {}
7678
fields = {}
7779
for field in model_fields(schema).values():
7880
if exclude_required and field.required:

0 commit comments

Comments
 (0)