@register.simple_tag
def clear_search_url(request):
    getvars = request.GET.copy()
    if 'search' in getvars:
        del getvars['search']
    if len(getvars.keys()) > 0:
        return "%s?%s" % (request.path, getvars.urlencode())
    else:
        return request.path
dataset/ETHPy150Open caseywstark/colab/colab/apps/feedback/templatetags/feedback_tags.py/clear_search_url/original