Skip to content

Commit 215e6e5

Browse files
Remove as_search_document_update validation check
No longer required as we have a default implementation
1 parent 73fd53b commit 215e6e5

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

elasticsearch_django/apps.py

-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ def _validate_model(model):
5050
"""Check that a model configured for an index subclasses the required classes."""
5151
if not hasattr(model, "as_search_document"):
5252
raise ImproperlyConfigured("'%s' must implement `as_search_document`." % model)
53-
if not hasattr(model, "as_search_document_update"):
54-
raise ImproperlyConfigured(
55-
"'%s' must implement `as_search_document_update`." % model
56-
)
5753
if not hasattr(model.objects, "get_search_queryset"):
5854
raise ImproperlyConfigured(
5955
"'%s.objects must implement `get_search_queryset`." % model

elasticsearch_django/models.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,7 @@ def update_search_document(self, *, index, update_fields):
347347
return
348348

349349
get_client().update(
350-
index=index,
351-
doc_type=self.search_doc_type,
352-
body={
353-
"doc": doc
354-
},
355-
id=self.pk,
350+
index=index, doc_type=self.search_doc_type, body={"doc": doc}, id=self.pk
356351
)
357352

358353
def delete_search_document(self, *, index):

0 commit comments

Comments
 (0)