From fb9fa946840105379868dfe304302c3c807395cb Mon Sep 17 00:00:00 2001 From: Weixin Bu <115976244+buweixin@users.noreply.github.com> Date: Mon, 13 Feb 2023 15:33:57 +0800 Subject: [PATCH] fix the sub tasks of container be duplicated (#107) --- openlcs/packages/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openlcs/packages/views.py b/openlcs/packages/views.py index abcbb0d6..0ab0b2de 100644 --- a/openlcs/packages/views.py +++ b/openlcs/packages/views.py @@ -912,6 +912,11 @@ def post(self, request, *args, **kwargs): if serializer_data and len(serializer_data) == 1: obj = serializer_data[0] + source_ready = 'source' in obj and \ + obj['source'] is None and parent != '' + if source_ready: + return Response(data={ + 'results': results}) obj_url = 'http://{}/rest/v1/components/{}/'.format( settings.HOSTNAME, obj.get('id', -1)) results['obj_url'] = obj_url