Ejemplo n.º 1
0
  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)
Ejemplo n.º 2
0
 def userprofile(self):
   if users.get_current_user():
     return Profile.by_user(users.get_current_user())