@username_required<EOL>def comment(thread_uid):
thread = storage.get_thread(thread_uid)<EOL>if not thread:<EOL><INDENT>abort(<NUM_LIT>)<EOL><DEDENT>text = request.form.get('<STR_LIT:text>') or '<STR_LIT>'<EOL>if not text:<EOL><INDENT>return error('<STR_LIT>')<EOL><DEDENT>storage.add_comment(thread_uid, g.username, text)<EOL>flash('<STR_LIT>', '<STR_LIT:success>')<EOL>return redirect(url_for('<STR_LIT>', thread_uid=thread_uid))<EOL>
Add new comment to given thread.

    :param thread: Thread unique ID.