Exemplo n.º 1
0
 def preprocess(self):
     templateDict = dict()
     
     user = self.checkFacebookSession()
     
     ModelActions.updateFacebookUserLocation(user.facebookId, 
                                             self.request.get("lat"), self.request.get("lon"))
     users = ModelActions.getAllUsers()
     args = simplejson.dumps(users)
     
     templateDict["content"] = args
     self.writeTemplate(self.TEMPLATE_FILE, templateDict)
     return
Exemplo n.º 2
0
    def checkFacebookSession(self):
        rUser = None
        
        user_id = facebook.parse_cookie(self.request.cookies.get("fb_user"))
        if user_id:
            #Check if we already registered the user
            rUser = ModelActions.getFacebookUser(user_id)

        return rUser