Exemplo n.º 1
0
 def post(self):
     key = self['email']
     redirect_url = str(
         self['redirect_url']) if self['redirect_url'] else '/community'
     if self['fb-pic-checkbox']:
         image_url = 'https://graph.facebook.com/' + self[
             "facebook_id"] + '/picture?type=normal&height=300&width=300'
     else:
         image_url = '/assets/img/landing/default_member.png'
     role = int(self['role']) if self['role'] else MEMBER_ROLE[ENGINEER]
     member = Member.create_or_update(key,
                                      name=self['name'],
                                      organization=self["organization"],
                                      designation=self["designation"],
                                      website=self["website"],
                                      twitter_handle=self["twitter_handle"],
                                      facebook_id=self["facebook_id"],
                                      bio=self["bio"],
                                      password=self['password'],
                                      image_url=image_url,
                                      role=role)
     self.session['member'] = key
     redirect_url = '/tracks'
     if role == MEMBER_ROLE[MANAGER]:
         Manager.create(member)
     else:
         managed_by = self['manager']
         ManagedUser.create(member, Manager._for(managed_by))
     self.redirect(redirect_url)
Exemplo n.º 2
0
 def post(self):
     key = self['email']
     redirect_url = str(self['redirect_url']) if self['redirect_url'] else '/community'
     if self['fb-pic-checkbox']:
         image_url = 'https://graph.facebook.com/'+self["facebook_id"]+'/picture?type=normal&height=300&width=300'
     else:
         image_url = '/assets/img/landing/default_member.png'
     role = int(self['role']) if self['role'] else MEMBER_ROLE[ENGINEER]
     member = Member.create_or_update(key, name=self['name'], organization=self["organization"],
                             designation=self["designation"], website=self["website"],
                             twitter_handle=self["twitter_handle"], facebook_id=self["facebook_id"], bio=self["bio"],
                             password=self['password'], image_url=image_url, role=role)
     self.session['member'] = key
     redirect_url = '/tracks'
     if role == MEMBER_ROLE[MANAGER]:
         Manager.create(member)
     else:
         managed_by = self['manager']
         ManagedUser.create(member, Manager._for(managed_by))
     self.redirect(redirect_url)
Exemplo n.º 3
0
 def get_managed_users(cls, manager_email):
     return ManagedUser.all().ancestor(
         Manager._for(manager_email)).fetch(limit=50)
Exemplo n.º 4
0
 def get_managed_users(cls, manager_email):
     return ManagedUser.all().ancestor(Manager._for(manager_email)).fetch(limit=50)