create API working for subscriber
diff --git a/xos/api/tenant/cord/subscriber.py b/xos/api/tenant/cord/subscriber.py
index 12e2551..5884b82 100644
--- a/xos/api/tenant/cord/subscriber.py
+++ b/xos/api/tenant/cord/subscriber.py
@@ -45,6 +45,7 @@
self.enable_uverse = value.get("uverse", self.get_default_attribute("enable_uverse"))
self.status = value.get("status", self.get_default_attribute("status"))
+
def update_features(self, value):
d=self.features
d.update(value)
@@ -96,8 +97,8 @@
class CordSubscriberSerializer(serializers.ModelSerializer, PlusSerializerMixin):
id = ReadOnlyField()
humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
- features = FeatureSerializer()
- identity = IdentitySerializer()
+ features = FeatureSerializer(required=False)
+ identity = IdentitySerializer(required=False)
related = serializers.DictField(required=False)
class Meta:
@@ -111,6 +112,10 @@
def getHumanReadableName(self, obj):
return obj.__unicode__()
+ def create(self, validated_data):
+ obj = self.Meta.model(**validated_data)
+ return obj
+
# @ensure_csrf_cookie
class CordSubscriberViewSet(XOSViewSet):
base_name = "subscriber"