aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-08-28 20:49:46 +0100
committerGravatar Chris Lovering <[email protected]>2023-08-28 21:39:42 +0100
commit99cde31b284b57b76d46e9e8ceb7de25a735434c (patch)
treea5d3f8f6f85d4ec7894cf511018b548b74fd8c7d
parentAdd pydantic BaseModel to target to ignore (diff)
Skip resolving for pydantic model fields
-rw-r--r--docs/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/utils.py b/docs/utils.py
index 3a20b87f..2b3cff5d 100644
--- a/docs/utils.py
+++ b/docs/utils.py
@@ -94,6 +94,10 @@ def linkcode_resolve(repo_link: str, domain: str, info: dict[str, str]) -> str |
pos = _global_assign_pos(source, symbol_name)
if pos is None:
+ if symbol_name in ("model_config", "model_fields"):
+ # These are ClassVars added by pydantic.
+ # Since they're not in our source code, we cannot resolve them to a url.
+ return None
raise Exception(f"Could not find symbol `{symbol_name}` in {module.__name__}.")
start, end = pos