Some Django REST Framework methods expect a get_object method when they see that PUT requests are allowed (e.g., GenericAPIView.metadata). For a bulk update view, the object being modified is the queryset itself, so we return that.
@@ -42,6 +42,9 @@ class BulkUpdateModelMixin(object):
``many=True`` ability from Django REST >= 2.2.5.
"""
+ def get_object(self):
+ return self.get_queryset()
+
def bulk_update(self, request, *args, **kwargs):
partial = kwargs.pop('partial', False)