Browse Source

[search] Make examples visible with the new dashboard permissions

Romain Rigaux 10 years ago
parent
commit
24cbaca

File diff suppressed because it is too large
+ 2 - 1
apps/search/src/search/fixtures/initial_search_examples.json


+ 1 - 1
apps/search/src/search/search_controller.py

@@ -45,7 +45,7 @@ class SearchController(object):
       return Collection.objects.filter(Q(owner=self.user) | Q(enabled=True)).order_by('-id')
 
   def get_shared_search_collections(self):
-    return Collection.objects.filter(Q(owner=self.user) | Q(enabled=True, owner__in=User.objects.filter(is_superuser=True))).order_by('-id')
+    return Collection.objects.filter(Q(owner=self.user) | Q(enabled=True, owner__in=User.objects.filter(is_superuser=True)) | Q(id__in=[20000000, 20000001, 20000002, 20000003])).order_by('-id')
 
   def get_owner_search_collections(self):
     if self.user.is_superuser:

+ 2 - 3
apps/search/src/search/views.py

@@ -209,7 +209,7 @@ def admin_collections(request, is_redirect=False):
         'enabled': collection.enabled,
         'isCoreOnly': collection.is_core_only,
         'absoluteUrl': collection.get_absolute_url(),
-        'owner': collection.owner.username,
+        'owner': collection.owner and collection.owner.username,
         'isOwner': collection.owner == request.user or request.user.is_superuser
       }
       collections.append(massaged_collection)
@@ -445,8 +445,7 @@ def _create_facet(collection, user, facet_id, facet_label, facet_field, widget_t
     'stacked': False,
     'limit': 10,
     'mincount': 0,
-    'isDate': False,
-    'andUp': False,  # Not used yet
+    'isDate': False
   }
 
   if widget_type in ('tree-widget', 'heatmap-widget'):

Some files were not shown because too many files changed in this diff