From 20f7be6726fb3c6f7f65f50d0ab959d704ad4e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mih=C3=A1lik?= Date: Sun, 15 Dec 2024 00:40:28 +0100 Subject: [PATCH] Remove download publication action (#481) --- competition/views.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/competition/views.py b/competition/views.py index 57e5507..542c13d 100644 --- a/competition/views.py +++ b/competition/views.py @@ -963,16 +963,6 @@ def perform_create(self, serializer): raise exceptions.PermissionDenied( 'Nedostatočné práva na vytvorenie tohoto objektu') - @action(methods=['get'], detail=True, url_path='download') - def download_publication(self, request, pk=None): - """Stiahne súbor publikácie""" - publication = self.get_object() - response = HttpResponse( - publication.file, content_type=mime_type(publication.file)) - response['Content-Disposition'] = f'attachment; '\ - f'filename="{publication.name}"' - return response - class GradeViewSet(viewsets.ReadOnlyModelViewSet): """Ročníky riešiteľov (Z9,S1 ...)"""