Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
39b77ec4
Commit
39b77ec4
authored
Mar 15, 2017
by
Robin Sonnabend
Browse files
Use correct GET-parameter for protocoltypes
/close
#54
parent
ae3ba7fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
39b77ec4
...
...
@@ -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
...
...
views/forms.py
View file @
39b77ec4
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment