diff --git a/aleksis/core/util/dav_handler/generic.py b/aleksis/core/util/dav_handler/generic.py index 1f57d0b679ed0ed43ab27e3eb3eec4f4ec94a55c..acd36baa14eced1a7c99807d36887c0a2b7ae432 100644 --- a/aleksis/core/util/dav_handler/generic.py +++ b/aleksis/core/util/dav_handler/generic.py @@ -124,7 +124,8 @@ class DAVHref(ElementHandler): obj = resource.get_objects(self.request._request).get(pk=pk) except resource.DoesNotExist: obj = NotFoundObject(self.content) - self.request.objects = list(self.request.objects).append(obj) + + list(self.request.objects).append(obj) class DAVProp(ElementHandler): diff --git a/aleksis/core/views.py b/aleksis/core/views.py index 908c12a51c167683aa35b55905c949b213d0f1bc..1d5397d82547d22292ffb8cb59c906a0766c5db7 100644 --- a/aleksis/core/views.py +++ b/aleksis/core/views.py @@ -1490,7 +1490,7 @@ class DAVSingleResourceView(DAVResourceView): except resource.DoesNotExist as exc: raise Http404 from exc - self._dav_request = DAVRequest(request, resource, objects[0]) + self._dav_request = DAVRequest(request, resource, objects) try: self._dav_request.parse() @@ -1508,12 +1508,12 @@ class DAVSingleResourceView(DAVResourceView): def get(self, request, name, id, *args, **kwargs): # noqa: A002 resource: DAVResource = self.get_object() try: - objects = resource.get_objects(request).get(pk=id) + obj = resource.get_objects(request).get(pk=id) except resource.DoesNotExist as exc: raise Http404 from exc response = HttpResponse(content_type=resource.get_dav_content_type()) - response.write(resource.get_dav_file_content(request, objects=objects)) + response.write(resource.get_dav_file_content(request, objects=[obj])) return response