handle missing data better in API

This commit is contained in:
Tao Bror Bojlén 2019-02-28 17:51:03 +00:00
parent b55485d7b8
commit 91f326e19b
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F

View file

@ -32,5 +32,8 @@ class NodeView(viewsets.ReadOnlyModelViewSet):
""" """
Endpoint to get a list of the graph's nodes in a SigmaJS-friendly format. Endpoint to get a list of the graph's nodes in a SigmaJS-friendly format.
""" """
queryset = Instance.objects.filter(status='success') queryset = Instance.objects.filter(status='success')\
.filter(x_coord__isnull=False)\
.filter(y_coord__isnull=False)\
.filter(user_count__isnull=False)
serializer_class = NodeSerializer serializer_class = NodeSerializer