Skip to content

Commit

Permalink
Merge pull request #1300 from tfranzel/attr_exp
Browse files Browse the repository at this point in the history
guard against broken __dir__ impl #1296
  • Loading branch information
tfranzel authored Sep 25, 2024
2 parents 0c12f23 + 9f0d166 commit 8faf63c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drf_spectacular/drainage.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ def set_override(obj: Any, prop: str, value: Any) -> Any:
def get_view_method_names(view, schema=None) -> List[str]:
schema = schema or view.schema
return [
item for item in dir(view) if callable(getattr(view, item)) and (
item for item in dir(view) if callable(getattr(view, item, None)) and (
item in view.http_method_names
or item in schema.method_mapping.values()
or item == 'list'
or hasattr(getattr(view, item), 'mapping')
or hasattr(getattr(view, item, None), 'mapping')
)
]

Expand Down

0 comments on commit 8faf63c

Please sign in to comment.