Skip to content
Snippets Groups Projects
Commit 523b9f9b authored by Martin Mareš's avatar Martin Mareš
Browse files

Místa: Formulář pro hledání používá GET

parent 9ff032ef
No related branches found
No related tags found
1 merge request!128Místa: hledání a další drobná vylepšení
This commit is part of merge request !128. Comments created here will be created in the context of that merge request.
......@@ -23,7 +23,7 @@ class PlaceSearchForm(FlaskForm):
submit = wtforms.SubmitField('Hledat')
@app.route('/org/place/<int:id>/', methods=('GET', 'POST'))
@app.route('/org/place/<int:id>/')
def org_place(id: int):
sess = db.get_session()
......@@ -31,11 +31,12 @@ def org_place(id: int):
if not place:
raise werkzeug.exceptions.NotFound()
search_form = PlaceSearchForm()
# Formulář nemá side-efekty, takže to může být GET bez CSRF.
search_form = PlaceSearchForm(request.args, meta={'csrf': False})
found_places = None
search_failed = False
search_limited = False
if search_form.validate_on_submit():
if 'submit' in request.args and search_form.validate():
query = search_form.query.data
query_words = query.split()
......
......@@ -50,7 +50,7 @@
</div>
{% endif %}
{{ wtf.quick_form(search_form, form_type='inline', button_map={'submit': 'primary'}) }}
{{ wtf.quick_form(search_form, method='GET', form_type='inline', button_map={'submit': 'primary'}) }}
{% if found_places %}
<table class=data>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment