Example #1
0
def get_cur_user():
    user = users.get_current_user()
    # try oauth
    if user is None:
        try:
            oauth_user = oauth.get_current_user()
            is_local_dummy_user = oauth_user.user_id() == '0' and oauth_user.email() == '*****@*****.**'
            if not is_local_dummy_user:
                user = oauth_user
        except oauth.OAuthRequestError:
            pass

    if user is not None:
        caching.add_recent_email(user.email())
    return user
Example #2
0
def get_cur_user():
    user = users.get_current_user()
    # try oauth
    if user is None:
        try:
            oauth_user = oauth.get_current_user()
            is_local_dummy_user = oauth_user.user_id(
            ) == '0' and oauth_user.email() == '*****@*****.**'
            if not is_local_dummy_user:
                user = oauth_user
        except oauth.OAuthRequestError:
            pass

    if user is not None:
        caching.add_recent_email(user.email())
    return user
Example #3
0
 def load(self):
     if self.req.user and not self.req.user.is_anonymous():
         caching.add_recent_email(self.req.user.email)
     page = WikiPage.get_by_path(self.path)
     page.set_cur_user(self.req.user)
     return page