diff --git a/api/products/views.py b/api/products/views.py index f880055..623db74 100644 --- a/api/products/views.py +++ b/api/products/views.py @@ -1928,7 +1928,9 @@ class ScanDataLabelsView(BaseView): def get(self, request): ret = [] - for x in ScanData.objects.all().order_by('pk').values('id', 'labels', 'image', 'code'): + for x in ScanData.objects.all().filter(labels__isnull=False).order_by('pk').values('id', 'labels', 'image', 'code'): + if not x.get('labels'): + continue ret.append({ 'id': x['id'], 'labels': x.get('labels'),