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
965
965
def to_representation(self, obj):
966
966
for attribute_name in dir(obj):
967
967
attribute = getattr(obj, attribute_name)
968
- if attribute_name('_'):
968
+ if attribute_name.startswith ('_'):
969
969
# Ignore private attributes.
970
970
pass
971
971
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
523
523
def to_representation(self, obj):
524
524
for attribute_name in dir(obj):
525
525
attribute = getattr(obj, attribute_name)
526
- if attribute_name('_'):
526
+ if attribute_name.startswith ('_'):
527
527
# Ignore private attributes.
528
528
pass
529
529
elif hasattr(attribute, '__call__'):
You can’t perform that action at this time.
0 commit comments