Ejemplo n.º 1
0
 def user(self):
     print "Frontend user get thingy"
     auth_dict = dict(token=str(g.frontend_token))
     response, content = self.request(endpoint="/user/", method="POST", body=auth_dict)
     if not response.status == 200:
         print "/user/ POST error"
         self.error_handler(content)
     user = User.from_dict(json.loads(content))
     return user
Ejemplo n.º 2
0
 def session_user(self):
     print "Frontend session user"
     auth_dict = dict(token=str(g.frontend_token))
     response, content = self.request(endpoint="/user/", method="POST", body=auth_dict)
     if not response.status == 200:
         print "/user/ POST error"
         self.error_handler(content)
     user = User.from_dict(json.loads(content))
     session["user"] = user.email.split("@")[0]
Ejemplo n.º 3
0
 def user(self):
     print "Frontend user get thingy"
     auth_dict = dict(token=str(g.frontend_token))
     response, content = self.request(endpoint="/user/",
                                      method="POST",
                                      body=auth_dict)
     if not response.status == 200:
         print "/user/ POST error"
         self.error_handler(content)
     user = User.from_dict(json.loads(content))
     return user
Ejemplo n.º 4
0
 def session_user(self):
     print "Frontend session user"
     auth_dict = dict(token=str(g.frontend_token))
     response, content = self.request(endpoint="/user/",
                                      method="POST",
                                      body=auth_dict)
     if not response.status == 200:
         print "/user/ POST error"
         self.error_handler(content)
     user = User.from_dict(json.loads(content))
     session["user"] = user.email.split("@")[0]