CORD-2865 add creator to CordSubscriberRoot
Change-Id: I6a021750b2f3fa0935768bd251d317778f71de40
diff --git a/xos/synchronizer/models/models.py b/xos/synchronizer/models/models.py
index 11b0ad9..28244fa 100644
--- a/xos/synchronizer/models/models.py
+++ b/xos/synchronizer/models/models.py
@@ -44,6 +44,15 @@
except IndexError:
raise XOSValidationError("Service RCORD cannot be found, please make sure that the model exists.")
+ # VSGServiceInstance will extract the creator from the Subscriber, as it needs a creator to create its
+ # Instance.
+ if not self.creator:
+ # If we weren't passed an explicit creator, then we will assume the caller is the creator.
+ if not getattr(self, "caller", None):
+ raise XOSProgrammingError("CordSubscriberRoot's self.caller was not set")
+ self.creator = self.caller
+
+ # TODO: What is this for?
if (not hasattr(self, 'caller') or not self.caller.is_admin):
if (self.has_field_changed("service_specific_id")):
raise XOSPermissionDenied("You do not have permission to change service_specific_id")