Skip to content

Commit 1ac0f63

Browse files
delimitrytomchristie
authored andcommitted
Fix private attributes ignore in documentation (encode#6601)
1 parent db65282 commit 1ac0f63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/api-guide/serializers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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__'):

docs/community/3.0-announcement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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__'):

0 commit comments

Comments
 (0)