Don't use config backend type if it's not set
diff --git a/planetstack/core/models/site.py b/planetstack/core/models/site.py
index af57ed2..33d9437 100644
--- a/planetstack/core/models/site.py
+++ b/planetstack/core/models/site.py
@@ -20,7 +20,7 @@
parent_queryset = parent.get_queryset() if hasattr(parent, "get_queryset") else parent.get_query_set()
if (backend_type):
- return parent_queryset.filter(Q(deployment__backend_type=config.observer_backend_type)|Q(backend_type=None))
+ return parent_queryset.filter(Q(deployment__backend_type=backend_type)|Q(backend_type=None))
else:
return parent_queryset
@@ -41,7 +41,7 @@
parent_queryset = parent.get_queryset() if hasattr(parent, "get_queryset") else parent.get_query_set()
if backend_type:
- return parent_queryset.filter(Q(backend_type=config.observer_backend_type)|Q(backend_type=None))
+ return parent_queryset.filter(Q(backend_type=backend_type)|Q(backend_type=None))
else:
return parent_queryset
@@ -61,7 +61,7 @@
parent_queryset = parent.get_queryset() if hasattr(parent, "get_queryset") else parent.get_query_set()
if backend_type:
- return parent_queryset.filter(Q(deployment__backend_type=config.observer_backend_type)|Q(backend_type=None))
+ return parent_queryset.filter(Q(deployment__backend_type=backend_type)|Q(backend_type=None))
else:
return parent_queryset
@@ -82,9 +82,9 @@
parent_queryset = parent.get_queryset() if hasattr(parent, "get_queryset") else parent.get_query_set()
if backend_type:
- return parent_queryset.filter(Q(backend_type=config.observer_backend_type)|Q(backend_type=None))
+ return parent_queryset.filter(Q(backend_type=backend_type)|Q(backend_type=None))
else:
- return parent_queryset.filter(Q(backend_type=config.observer_backend_type)|Q(backend_type=None))
+ return parent_queryset.filter(Q(backend_type=backend_type)|Q(backend_type=None))
# deprecated in django 1.7 in favor of get_queryset().
def get_query_set(self):