See #170: fetch channel outbox on discovery/detail

This commit is contained in:
Eliot Berriot 2020-03-31 15:54:18 +02:00
parent 0eeead34a4
commit 7435167361
No known key found for this signature in database
GPG key ID: 6B501DFD73514E14
11 changed files with 297 additions and 28 deletions

View file

@ -110,6 +110,15 @@ class ChannelViewSet(
else:
return super().list(request, *args, **kwargs)
def get_object(self):
obj = super().get_object()
if (
self.action == "retrieve"
and self.request.GET.get("refresh", "").lower() == "true"
):
obj = music_views.refetch_obj(obj, self.get_queryset())
return obj
@decorators.action(
detail=True,
methods=["post"],