Skip to content

Commit

Permalink
fix search redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
magical committed Nov 2, 2018
1 parent 2baddc1 commit 89ed84a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions splinext/pokedex/views/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 89ed84a

Please sign in to comment.