Skip to content

Commit

Permalink
Properly handle subclasses of SerializerMethodField (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
belak committed Oct 26, 2020
1 parent d277870 commit 789a96c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/drf_yasg/inspectors/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def field_to_swagger_object(self, field, swagger_object_type, use_references, **
if not isinstance(field, serializers.SerializerMethodField):
return NotHandled

method = getattr(field.parent, field.method_name)
method = getattr(field.parent, field.method_name, None)
if method is None:
return NotHandled

Expand Down

0 comments on commit 789a96c

Please sign in to comment.