Fix search=None issue
svn: r19816
This commit is contained in:
parent
120c6b00b9
commit
e4faea4cf3
@ -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
|
||||
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user