fix exceptions in old cordsubscriber api
diff --git a/xos/core/xoslib/methods/cordsubscriber.py b/xos/core/xoslib/methods/cordsubscriber.py
index f0bee26..0be9b33 100644
--- a/xos/core/xoslib/methods/cordsubscriber.py
+++ b/xos/core/xoslib/methods/cordsubscriber.py
@@ -118,7 +118,7 @@
def get(self, request, format=None):
instances=[]
for subscriber in CordSubscriber.get_tenant_objects().all():
- for user in subscriber.users:
+ for user in subscriber.devices:
instances.append( serialize_user(subscriber, user) )
return Response(instances)
@@ -140,7 +140,7 @@
def get(self, request, format=None, pk=0):
parts = pk.split("-")
subscriber = CordSubscriber.get_tenant_objects().filter(id=parts[0])
- for user in subscriber.users:
+ for user in subscriber.devices:
return Response( [ serialize_user(subscriber, user) ] )
raise XOSNotFound("Failed to find user %s" % pk)
@@ -236,7 +236,7 @@
def get_users(self, request, pk=None):
subscriber = self.get_object()
- return Response(subscriber.users)
+ return Response(subscriber.devices)
def get_user_level(self, request, pk=None, uid=None):
subscriber = self.get_object()
@@ -278,7 +278,7 @@
def clear_users(self, request, pk=None):
subscriber = self.get_object()
- subscriber.users = []
+ subscriber.devices = []
subscriber.save()
return Response( "Okay" )
@@ -322,7 +322,7 @@
def setup_demo_subscriber(self, subscriber):
# nuke the users and start over
- subscriber.users = []
+ subscriber.devices = []
subscriber.create_user(name="Mom's PC", mac="010203040506", level="PG_13")
subscriber.create_user(name="Dad's PC", mac="90E2Ba82F975", level="PG_13")
subscriber.create_user(name="Jack's Laptop", mac="685B359D91D5", level="PG_13")