Skip to content

Commit

Permalink
Fix 500 when accessing metadata endpoint directly
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed Nov 29, 2023
1 parent 5858354 commit a5b1110
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions onadata/apps/api/viewsets/metadata_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ class MetaDataViewSet(viewsets.ModelViewSet):
def retrieve(self, request, *args, **kwargs):
self.object = self.get_object()

if isinstance(request.accepted_renderer, MediaFileRenderer) \
and self.object.data_file is not None:

return get_media_file_response(self.object)
if (
isinstance(request.accepted_renderer, MediaFileRenderer)
and self.object.data_file is not None
):
return get_media_file_response(self.object, request)

serializer = self.get_serializer(self.object)

Expand Down

0 comments on commit a5b1110

Please sign in to comment.