def POST_over18(self, over18, dest): if over18 == 'yes': if c.user_is_loggedin and not c.errors: c.user.pref_over_18 = True c.user._commit() else: set_over18_cookie() return self.redirect(dest) else: if c.user_is_loggedin and not c.errors: c.user.pref_over_18 = False c.user._commit() else: delete_over18_cookie() return self.redirect('/')