Fix search=None issue

svn: r19816
This commit is contained in:
Doug Blank 2012-06-10 03:29:12 +00:00
parent 120c6b00b9
commit e4faea4cf3
2 changed files with 7 additions and 7 deletions

View File

@ -103,10 +103,10 @@ def context_processor(request):
context["sitename"] = Config.objects.get(setting="sitename").value
context["default"] = ""
search = request.GET.get("search", None) or request.POST.get("search", None)
page = request.GET.get("page", None) or request.POST.get("page", None)
context["page"] = page
context["search"] = search
search = request.GET.get("search", "") or request.POST.get("search", "")
page = request.GET.get("page", "") or request.POST.get("page", "")
context["page"] = page
context["search"] = search
context["args"] = build_args(search=search, page=page)
return context

View File

@ -232,7 +232,7 @@ def build_args(**kwargs):
retval = ""
first = True
for key in kwargs:
if kwargs[key] is not None:
if kwargs[key] is not "":
if first:
retval+= "?"
first = False
@ -242,8 +242,8 @@ def build_args(**kwargs):
return retval
def build_search(request):
search = request.GET.get("search", None) or request.POST.get("search", None)
page = request.GET.get("page", None) or request.POST.get("page", None)
search = request.GET.get("search", "") or request.POST.get("search", "")
page = request.GET.get("page", "") or request.POST.get("page", "")
return build_args(search=search, page=page)
def make_button(text, url, *args):