def get_current_user(self): username_raw = self.get_secure_cookie(ACCOUNT_COOKIE_NAME) token = self.get_secure_cookie(ACCOUNT_TOKEN_COOKIE_NAME) if username_raw and token: username = username_raw.decode('ascii') if username and User.check_account_session(username, token): return username