[CORD-3068] Fix E2E test
Change-Id: Ia40364d3bd4770d5fe256c999f230e9b4216cab1
diff --git a/xos/core/models/serviceinstance.py b/xos/core/models/serviceinstance.py
index 7dff675..06919d6 100644
--- a/xos/core/models/serviceinstance.py
+++ b/xos/core/models/serviceinstance.py
@@ -14,7 +14,7 @@
# limitations under the License.
from django.db.models.fields import NOT_PROVIDED
-from xos.exceptions import *
+from xos.exceptions import XOSValidationError, XOSMissingField, XOSDuplicateKey
from serviceinstance_decl import *
class ServiceInstance(ServiceInstance_decl):
@@ -39,7 +39,7 @@
raise XOSDuplicateKey("service_specific_id %s already exists" % self.service_specific_id, fields={
"service_specific_id": "duplicate key"})
- def save(self, *args, **kwargs):
+ def set_owner(self):
if hasattr(self, "OWNER_CLASS_NAME"):
owner_class = self.get_model_class_by_name(self.OWNER_CLASS_NAME)
if not owner_class:
@@ -70,6 +70,9 @@
(self._meta.get_field("owner").default!=NOT_PROVIDED):
self.owner = Service.objects.get(id = self._meta.get_field("owner").default)
+ def save(self, *args, **kwargs):
+ self.set_owner()
+
# If the model has a Creator and it's not specified, then attempt to default to the Caller. Caller is
# automatically filled in my the API layer. This code was typically used by ServiceInstances that lead to
# instance creation.