master
nathaniel smith 2015-08-01 16:36:22 -07:00
parent d93cf586a1
commit 8607eedfa3
2 changed files with 15 additions and 4 deletions

View File

@ -63,7 +63,11 @@ def get_guestbook():
@app.route('/guestbook', methods=['POST']) @app.route('/guestbook', methods=['POST'])
def post_guestbook(): def post_guestbook():
save_post(request.form['name'], request.form['message']) message = request.form['message'][0:400]
name = request.form['name'][0:140]
captcha = request.form['hmm']
print(captcha)
save_post(name, message)
return redirect("/guestbook") return redirect("/guestbook")
@app.route('/helpdesk', methods=['GET']) @app.route('/helpdesk', methods=['GET'])
@ -73,7 +77,6 @@ def helpdesk():
if __name__ == '__main__': if __name__ == '__main__':
if len(argv) == 2: if len(argv) == 2:
data_dir = argv[1] data_dir = argv[1]
else: else:
data_dir = mkdtemp() data_dir = mkdtemp()

View File

@ -11,14 +11,22 @@
<tr> <tr>
<th>name!</th> <th>name!</th>
<th>message!</th> <th>message!</th>
<th>are you a robot!?</th>
</tr> </tr>
<tr> <tr>
<td> <td>
<input type="text" name="name" /> <input type="text" name="name" maxlength="140" />
</td> </td>
<td> <td>
<textarea style="border:0px"name="message" cols="100" rows="10"></textarea> <textarea maxlength="400" style="border:0px"name="message" cols="100" rows="10"></textarea>
</td> </td>
<td>
<radiogroup>
<radio name="hmm"label="yeah" accesskey="Y" selected="true" value="yeah"/>
<radio name="hmm" label="nope" accesskey="N" value="nope" />
</radiogroup>
</td>
</tr>
</table> </table>
<input style="font-size:200%" type="submit" value="sign"/> <input style="font-size:200%" type="submit" value="sign"/>
</form> </form>