workaround for rest_framework post bug
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index c6e0061..48d1677 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -58,6 +58,13 @@
super(Tenant, self).__init__(*args, **kwargs)
def __unicode__(self):
+ if not hasattr(self, "provider_service"):
+ # When the REST API does a POST on a CordSubscriber object, for
+ # some reason there is no provider_service field. All of the other
+ # fields are there. Provider_service is even in the dir(). However,
+ # trying to getattr() on it will fail.
+ return "confused-tenant-object"
+
if self.subscriber_service:
return u'%s service %s on service %s' % (str(self.kind), str(self.subscriber_service.id), str(self.provider_service.id))
elif self.subscriber_tenant: