示例#1
0
文件: web.py 项目: westmark/maeve
  def wrapped(self, *args, **kwargs):
    if users.get_current_user() and self.userprofile is None:
      if users.is_current_user_admin():
        self.userprofile = Profile.create(user=users.get_current_user())
      else:
        redirect_to = '/user/profile/create?next={0}'.format(self.request.path + (self.request.query and ('?' + self.request.query) or ''))
        return self.redirect(redirect_to)

    return fn(self, *args, **kwargs)
示例#2
0
文件: web.py 项目: westmark/maeve
 def userprofile(self):
   if users.get_current_user():
     return Profile.by_user(users.get_current_user())