diff --git a/SAS/TMSS/src/tmss/tmssapp/viewsets/scheduling.py b/SAS/TMSS/src/tmss/tmssapp/viewsets/scheduling.py index 8ad75743cc38917a2fac4714a2744f4d3a58f4a5..9883d4058ddd4a16a6a84fe0bd49cde7f857a00f 100644 --- a/SAS/TMSS/src/tmss/tmssapp/viewsets/scheduling.py +++ b/SAS/TMSS/src/tmss/tmssapp/viewsets/scheduling.py @@ -35,8 +35,6 @@ from lofar.sas.tmss.tmss.tmssapp.renderers import PlainTextRenderer from rest_framework.views import APIView from rest_framework.decorators import api_view, renderer_classes -from lofar.sas.tmss.tmss.tmssapp.adapters.sip import generate_sip_for_dataproduct - class TextPlainAutoSchema(SwaggerAutoSchema): def get_produces(self): @@ -322,6 +320,7 @@ class DataproductViewSet(LOFARViewSet): @action(methods=['get'], detail=True, url_name="sip") def sip(self, request, pk=None): dataproduct = get_object_or_404(models.Dataproduct, pk=pk) + from lofar.sas.tmss.tmss.tmssapp.adapters.sip import generate_sip_for_dataproduct return HttpResponse(generate_sip_for_dataproduct(dataproduct).get_prettyxml(), content_type='application/xml') @swagger_auto_schema(responses={200: 'The SIP graph for this dataproduct', @@ -331,6 +330,7 @@ class DataproductViewSet(LOFARViewSet): def sip_graph(self, request, pk=None): dataproduct = get_object_or_404(models.Dataproduct, pk=pk) from lofar.lta.sip import visualizer + from lofar.sas.tmss.tmss.tmssapp.adapters.sip import generate_sip_for_dataproduct return HttpResponse(visualizer.visualize_sip(generate_sip_for_dataproduct(dataproduct)), content_type='image/svg+xml')