Skip to content

Commit 56a7df8

Browse files
committed
fix(property objectID): Check attribute on model, not index
1 parent d166bcf commit 56a7df8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

algoliasearch_django/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def __init__(self, model, client, settings):
125125
self.fields)))
126126

127127
# Check custom_objectID
128-
if self.custom_objectID in chain(['pk'], all_model_fields) or hasattr(self, self.custom_objectID):
128+
if self.custom_objectID in chain(['pk'], all_model_fields) or hasattr(model, self.custom_objectID):
129129
self.objectID = get_model_attr(self.custom_objectID)
130130
else:
131131
raise AlgoliaIndexError('{} is not a model field of {}'.format(

0 commit comments

Comments
 (0)