fix(github): use raw_data fallback for org attributes not exposed by PyGithub

This commit is contained in:
Andoni A.
2026-03-16 16:43:36 +01:00
parent 717ec39280
commit 5691777fd2
@@ -162,6 +162,9 @@ class Organization(GithubService):
"""Return attribute value if it matches expected type and is not a mock placeholder."""
try:
value = getattr(org, attribute, None)
# Fallback to raw_data for fields not exposed as PyGithub properties
if value is None and hasattr(org, "raw_data"):
value = org.raw_data.get(attribute)
if hasattr(value, "_mock_parent"):
return None
if expected_type is bool and isinstance(value, bool):