File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -965,7 +965,7 @@ The following class is an example of a generic serializer that can handle coerci
965965 def to_representation(self, obj):
966966 for attribute_name in dir(obj):
967967 attribute = getattr(obj, attribute_name)
968- if attribute_name('_'):
968+ if attribute_name.startswith ('_'):
969969 # Ignore private attributes.
970970 pass
971971 elif hasattr(attribute, '__call__'):
Original file line number Diff line number Diff line change @@ -523,7 +523,7 @@ The following class is an example of a generic serializer that can handle coerci
523523 def to_representation(self, obj):
524524 for attribute_name in dir(obj):
525525 attribute = getattr(obj, attribute_name)
526- if attribute_name('_'):
526+ if attribute_name.startswith ('_'):
527527 # Ignore private attributes.
528528 pass
529529 elif hasattr(attribute, '__call__'):
You can’t perform that action at this time.
0 commit comments