Make a function for parsing help query param

Our templates are a littered with `request.args.get('help', '0')`.
This commit refactors these into a single helper method, which can be
used by the view functions, then passed to the template.

This makes the templates cleaner, and should make it easier to refactor
`help` out of the query parameters entirely in the future.
This commit is contained in:
Chris Hill-Scott
2016-07-05 11:39:07 +01:00
parent d71269ca87
commit 80e0832f7d
7 changed files with 22 additions and 13 deletions

View File

@@ -186,3 +186,7 @@ class Spreadsheet():
file_type=extension,
file_content=file_content.getvalue()
).to_array(), filename)
def get_help_argument():
return request.args.get('help') if request.args.get('help') in ('1', '2', '3') else None