CORD-2753 set default owner for MCordSubscriberInstance
Change-Id: I7183b4a8a515c5a9afa0b2963ff8d63bbaca9c1f
diff --git a/xos/models/mcord.xproto b/xos/models/mcord.xproto
index 5a5124e..033e0c7 100644
--- a/xos/models/mcord.xproto
+++ b/xos/models/mcord.xproto
@@ -10,6 +10,7 @@
message MCordSubscriberInstance (ServiceInstance) {
option verbose_name = "MCORD Subscriber";
option description = "This model holds the informations of a Mobile Subscriber in CORD";
+ option owner_class_name="MCordSubscriberService";
required string imsi_number = 1 [max_length = 30, content_type = "stripped", blank = False, null = False, db_index = False];
optional string apn_number = 2 [max_length = 30, content_type = "stripped", blank = True, null = True, db_index = False];
diff --git a/xos/models/models.py b/xos/models/models.py
index 80aad19..c1471f4 100644
--- a/xos/models/models.py
+++ b/xos/models/models.py
@@ -16,13 +16,6 @@
proxy = True
def save(self, *args, **kwargs):
- # NOTE someone is setting owner_id, so just override it for now
- try:
- mcord_service = MCordSubscriberService.objects.all()[0]
- self.owner_id = mcord_service.id
- except IndexError:
- raise XOSValidationError("Service MCORD cannot be found, please make sure that the model exists.")
-
# if we don't have a name, use the IMSI number has a name
if not self.name:
self.name = self.imsi_number