def _context(request): filter = SearchFilter(request.GET) return {'searcherror': filter.searcherror()}
def wrapper(*args, **kwargs): if args[0].method == 'GET': filter = SearchFilter(args[0].GET) if filter.searcherror() == False: return HttpResponseRedirect('/search/' + args[0].GET['q'] + '/1/') return func(*args, **kwargs)