Skip to content

Commit

Permalink
bugfix functools.partial methods in django-filters #290
Browse files Browse the repository at this point in the history
  • Loading branch information
tfranzel committed Feb 7, 2021
1 parent d53133f commit 2eb7fe2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drf_spectacular/contrib/django_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def resolve_filter_field(self, auto_schema, model, filterset_class, field_name,
else:
filter_method = getattr(filterset_class, filter_field.method)

filter_method_hints = typing.get_type_hints(filter_method)
try:
filter_method_hints = typing.get_type_hints(filter_method)
except: # noqa: E722
filter_method_hints = {}

if 'value' in filter_method_hints and is_basic_type(filter_method_hints['value']):
schema = build_basic_type(filter_method_hints['value'])
Expand Down

0 comments on commit 2eb7fe2

Please sign in to comment.