def post(self): user = users.get_current_user() # use the last interval from the previous session as the first interval in the current session if user: # create a new session initial_interval = Alert.last_interval(user) session = FocusSession() key = session.put() template_values = {"session_key": key, "interval": initial_interval} render(self, "stop.html", template_values) else: self.redirect(users.create_login_url(self.request.uri))