Skip to content

Commit

Permalink
Search requests always display stream
Browse files Browse the repository at this point in the history
  • Loading branch information
samluescher committed Feb 18, 2016
1 parent 993b22d commit c505f16
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions media_tree/admin/filenode_admin.py
Expand Up @@ -41,6 +41,7 @@
from django.conf import settings
from django.contrib import admin, messages
from django.contrib.admin.options import csrf_protect_m
from django.contrib.admin.views.main import SEARCH_VAR
from django.template.loader import render_to_string
from django.shortcuts import render_to_response
from django.core.exceptions import PermissionDenied
Expand Down Expand Up @@ -234,6 +235,7 @@ def get_urls(self):
def init_changelist_view_options(self, request):
context = {}

list_type = None
if 'list_type' in request.GET:
request.GET = request.GET.copy()
list_type = request.GET.get('list_type')
Expand All @@ -242,9 +244,15 @@ def init_changelist_view_options(self, request):
request.session['list_type'] = list_type
else:
request.session['list_type'] = None
list_type = None

set_request_attr(request, 'list_type', request.session['list_type'])
context.update({'list_type': request.session['list_type']})
search = request.GET.get(SEARCH_VAR, None)
if search and search != '':
list_type = 'stream'

list_type = list_type or request.session.get('list_type', None)
set_request_attr(request, 'list_type', list_type)
context.update({'list_type': list_type})

if 'thumbnail_size' in request.GET:
request.GET = request.GET.copy()
Expand Down

0 comments on commit c505f16

Please sign in to comment.