We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2f076fa + d9527ef commit 3e691b2Copy full SHA for 3e691b2
src/django_elasticsearch_dsl_drf/viewsets.py
@@ -22,6 +22,7 @@
22
23
from .pagination import PageNumberPagination
24
from .utils import DictionaryProxy
25
+from .versions import ELASTICSEARCH_GTE_7_0
26
27
__title__ = 'django_elasticsearch_dsl_drf.viewsets'
28
__author__ = 'Artur Barseghyan <[email protected]>'
@@ -231,8 +232,12 @@ def get_object(self):
231
232
233
# May raise a permission denied
234
self.check_object_permissions(self.request, obj)
235
+ if ELASTICSEARCH_GTE_7_0:
236
+ dictionary_proxy = DictionaryProxy(obj.to_dict())
237
+ else:
238
+ dictionary_proxy = DictionaryProxy(obj)
239
- return DictionaryProxy(obj)
240
+ return dictionary_proxy
241
242
elif count > 1:
243
raise Http404(
0 commit comments