Ejemplo n.º 1
0
def show(request, profile_id):
    profile = Profile.all().filter('uid =', profile_id).get()
    #bd_end_user = EndUser(end_user_login=profile.uid)

    eul = "profile:%s" % profile.uid
    c = Client(settings.BDM_SECRET, settings.BDM_KEY)
    try:
        bd_end_user = c.get('end_user/%s' % eul)[0]
    except ValueError, e:
        payload = dict(end_user_login=eul)
        bd_end_user = c.post('end_user', payload=payload)[0]
Ejemplo n.º 2
0
 def process_request(self, request):
     user = users.get_current_user()
     request.user = None
     request.profile = None
     if user:
         request.user = user
         try:
             request.profile = Profile.all().filter('user =', user)[0]
         except IndexError, e:
             p = Profile(user=user)
             p.name = user.nickname()
             p.put()
             request.profile = p