Commit 39b77ec4 authored by Robin Sonnabend's avatar Robin Sonnabend

Use correct GET-parameter for protocoltypes

/close #54
parent ae3ba7fb
......@@ -354,7 +354,7 @@ def list_protocols():
protocoltypes = ProtocolType.get_public_protocoltypes(user)
search_form = SearchForm(protocoltypes)
if protocoltype_id is not None:
search_form.protocoltype.data = protocoltype_id
search_form.protocoltype_id.data = protocoltype_id
protocoltype = ProtocolType.query.filter_by(id=protocoltype_id).first()
if search_term is not None:
search_form.search.data = search_term
......@@ -769,7 +769,7 @@ def list_todos():
protocoltypes = ProtocolType.get_public_protocoltypes(user)
search_form = SearchForm(protocoltypes)
if protocoltype_id is not None:
search_form.protocoltype.data = protocoltype_id
search_form.protocoltype_id.data = protocoltype_id
protocoltype = ProtocolType.query.filter_by(id=protocoltype_id).first()
if search_term is not None:
search_form.search.data = search_term
......@@ -901,14 +901,14 @@ def list_decisions():
protocoltype = None
protocoltype_id = None
try:
protocoltype_id = int(request.args.get("protocoltype"))
protocoltype_id = int(request.args.get("protocoltype_id"))
except (ValueError, TypeError):
pass
search_term = request.args.get("search")
protocoltypes = ProtocolType.get_public_protocoltypes(user)
search_form = SearchForm(protocoltypes)
if protocoltype_id is not None:
search_form.protocoltype.data = protocoltype_id
search_form.protocoltype_id.data = protocoltype_id
protocoltype = ProtocolType.query.filter_by(id=protocoltype_id).first()
if search_term is not None:
search_form.search.data = search_term
......
......@@ -182,11 +182,11 @@ class TopForm(FlaskForm):
class SearchForm(FlaskForm):
search = StringField("Suchbegriff")
protocoltype = SelectField("Typ", choices=[], coerce=int)
protocoltype_id = SelectField("Typ", choices=[], coerce=int)
def __init__(self, protocoltypes, **kwargs):
super().__init__(**kwargs)
self.protocoltype.choices = get_protocoltype_choices(protocoltypes)
self.protocoltype_id.choices = get_protocoltype_choices(protocoltypes)
class NewTodoForm(FlaskForm):
protocoltype_id = SelectField("Typ", choices=[], coerce=int)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment