From 89ed84a342cc690011c00265416d82d9fb9359be Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Fri, 2 Nov 2018 08:02:30 -0700 Subject: [PATCH] fix search redirects --- splinext/pokedex/views/search.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/splinext/pokedex/views/search.py b/splinext/pokedex/views/search.py index 936d28ea..77543b2f 100644 --- a/splinext/pokedex/views/search.py +++ b/splinext/pokedex/views/search.py @@ -8,7 +8,6 @@ from wtforms.ext.sqlalchemy.fields import QuerySelectField import pokedex.db.tables as t -#from pylons import url import pyramid.httpexceptions as exc from sqlalchemy.orm import aliased, joinedload, joinedload_all from sqlalchemy.sql import func, and_, not_, or_ @@ -647,7 +646,7 @@ class F(PokemonSearchForm): # If this is the first time the form was submitted, redirect to a URL # with only non-default values if c.form.is_valid and c.form.was_submitted and c.form.needs_shortening: - return redirect(url.current(**c.form.cleansed_data.mixed())) + return redirect(request.current_route_url(_query=c.form.cleansed_data.mixed())) if not c.form.was_submitted or not c.form.is_valid: # Either blank, or errortastic. Skip the logic and just send the @@ -1409,7 +1408,7 @@ class F(MoveSearchForm): # If this is the first time the form was submitted, redirect to a URL # with only non-default values if c.form.is_valid and c.form.was_submitted and c.form.needs_shortening: - return redirect(url.current(**c.form.cleansed_data.mixed())) + return redirect(request.current_route_url(_query=c.form.cleansed_data.mixed())) if not c.form.was_submitted or not c.form.is_valid: # Either blank, or errortastic. Skip the logic and just send the