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["sitename"] = Config.objects.get(setting="sitename").value
|
||||||
context["default"] = ""
|
context["default"] = ""
|
||||||
|
|
||||||
search = request.GET.get("search", None) or request.POST.get("search", None)
|
search = request.GET.get("search", "") or request.POST.get("search", "")
|
||||||
page = request.GET.get("page", None) or request.POST.get("page", None)
|
page = request.GET.get("page", "") or request.POST.get("page", "")
|
||||||
context["page"] = page
|
context["page"] = page
|
||||||
context["search"] = search
|
context["search"] = search
|
||||||
context["args"] = build_args(search=search, page=page)
|
context["args"] = build_args(search=search, page=page)
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ def build_args(**kwargs):
|
|||||||
retval = ""
|
retval = ""
|
||||||
first = True
|
first = True
|
||||||
for key in kwargs:
|
for key in kwargs:
|
||||||
if kwargs[key] is not None:
|
if kwargs[key] is not "":
|
||||||
if first:
|
if first:
|
||||||
retval+= "?"
|
retval+= "?"
|
||||||
first = False
|
first = False
|
||||||
@ -242,8 +242,8 @@ def build_args(**kwargs):
|
|||||||
return retval
|
return retval
|
||||||
|
|
||||||
def build_search(request):
|
def build_search(request):
|
||||||
search = request.GET.get("search", None) or request.POST.get("search", None)
|
search = request.GET.get("search", "") or request.POST.get("search", "")
|
||||||
page = request.GET.get("page", None) or request.POST.get("page", None)
|
page = request.GET.get("page", "") or request.POST.get("page", "")
|
||||||
return build_args(search=search, page=page)
|
return build_args(search=search, page=page)
|
||||||
|
|
||||||
def make_button(text, url, *args):
|
def make_button(text, url, *args):
|
||||||
|
Loading…
Reference in New Issue
Block a user