def username_required(func):
@wraps(func)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>r"""<STR_LIT>"""<EOL>if not g.username:<EOL><INDENT>return to_index()<EOL><DEDENT>return func(*args, **kwargs)<EOL><DEDENT>return wrapper<EOL>
Make sure that username stored in session, before executing actual view
function.

:param func: View function to decorate.