Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Commit

Permalink
Example app fails on 2nd & subsequent requests
Browse files Browse the repository at this point in the history
The example app, on first request, writes a session cookie. On subsequent requests,
it tries to read that cookie in and convert 'last_request_at' to an isoformatted date
string. However, 'last_request_at' is an integer epoch date, and ints have no isoformat()
method. I chose to change the cookie-reading code rather than the writing code here.
  • Loading branch information
bkjones committed Apr 28, 2014
1 parent 0737a07 commit aeb5dbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tinman/example.py
Expand Up @@ -2,6 +2,7 @@
Tinman Test Application
"""
from datetime import date
import logging
from tornado import web

Expand Down Expand Up @@ -51,7 +52,8 @@ def get(self, *args, **kwargs):

session = self.session.as_dict()
if session['last_request_at']:
session['last_request_at'] = session['last_request_at'].isoformat()
session['last_request_at'] = str(date.fromtimestamp(
session['last_request_at']))

# Send a JSON string for our test
self.write({'message': 'Hello World',
Expand Down

0 comments on commit aeb5dbf

Please sign in to comment.