Refactor codes for subscriptions
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / biz / create_subscription.py
index db529a7..6802c22 100644 (file)
@@ -25,6 +25,7 @@ from rest_framework import status
 from lcm.nf import const
 from lcm.pub.database.models import SubscriptionModel
 from lcm.pub.exceptions import NFLCMException
+from lcm.pub.exceptions import NFLCMExceptionSeeOther
 from lcm.pub.utils.values import ignore_case_get
 
 logger = logging.getLogger(__name__)
@@ -116,8 +117,8 @@ class CreateSubscription:
             return True
         for subscription in subscriptions:
             if self.check_filter_exists(subscription):
-                raise NFLCMException("Already Subscription exists with the "
-                                     "same callbackUri and filter")
+                raise NFLCMExceptionSeeOther("Already Subscription exists with the "
+                                             "same callbackUri and filter")
         return False
 
     def save_db(self):