Fix query nsd 97/97297/1
authorhewei-cmss <hewei@cmss.chinamobile.com>
Fri, 18 Oct 2019 08:49:19 +0000 (16:49 +0800)
committerhewei-cmss <hewei@cmss.chinamobile.com>
Fri, 18 Oct 2019 08:49:19 +0000 (16:49 +0800)
Issue-ID: VFC-1504

Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
Change-Id: I624e26c39c04708b068a97fd31a2b0b85171fd89

catalog/packages/biz/ns_descriptor.py

index 18f6b88..8f54999 100644 (file)
@@ -66,6 +66,9 @@ class NsDescriptor(object):
             ns_pkgs = NSPackageModel.objects.filter(nsdId=nsdId)
         else:
             ns_pkgs = NSPackageModel.objects.all()
+        if not ns_pkgs.exists():
+            logger.debug("NSD infos does not exist.")
+            return []
         response_data = []
         for ns_pkg in ns_pkgs:
             data = self.fill_resp_data(ns_pkg)