Change back search default
@@ -40,13 +40,15 @@ def elastic_search(request, project_slug=None):
:param project_slug: Sent when the view is a project search
"""
+ request_type = None
if project_slug:
queryset = Project.objects.protected(request.user)
project_obj = get_object_or_404(queryset, slug=project_slug)
+ request_type = request.GET.get('type', 'file')
user_input = UserInput(
query=request.GET.get('q'),
- type=request.GET.get('type', 'file'),
+ type=request_type or request.GET.get('type', 'project'),
project=project_slug or request.GET.get('project'),
version=request.GET.get('version', LATEST),
taxonomy=request.GET.get('taxonomy'),
