Exemplo n.º 1
0
 def post(self):
     args = parser.parse_args()
     password = args.get('password')
     username = args.get('username')
     name = args.get('name')
     logging.debug("sign up {}".format(username))
     people = People.getbyusername(username)
     if people:
         logging.debug("username already taken")
         raise UserAlreadyExistsError
     else:
         people = People.create(name, username)
         people.get().genpass(password)
         user = User.get(username)
         if user is None:
             user = User.get(username)
             logging.warning("User get retry")
         if user is not None:
             login_user(user, remember=True)
         else:
             logging.warning("Still not found")
         return {
             'id': people.id(),
             "username": username,
             "name": name,
             "admin": False
         }
Exemplo n.º 2
0
    def post(self):
        logging.debug("creating people")
        args = parser.parse_args()
        people_details = args
        if People.getbyusername(args.get('username')):
            logging.warning("Username already taken")
            raise UserAlreadyExistsError
        else:

            people = People.create(args.get('name'), args.get('username'))
            people.get().genpass(args.get('password'))
            people_details['id'] = people.id()

        return {'people': people_details}
Exemplo n.º 3
0
    def post(self):
        logging.debug("creating people")
        args = parser.parse_args()
        people_details = args
        if People.getbyusername(args.get('username')):
            logging.warning("Username already taken")
            raise UserAlreadyExistsError
        else:

            people = People.create(args.get('name'), args.get('username'))
            people.get().genpass(args.get('password'))
            people_details['id'] = people.id()

        return {'people': people_details}
Exemplo n.º 4
0
 def post(self):
     args = parser.parse_args()
     password = args.get('password')
     username = args.get('username')
     name = args.get('name')
     logging.debug("sign up {}".format(username))
     people = People.getbyusername(username)
     if people:
         logging.debug("username already taken")
         raise UserAlreadyExistsError
     else:
         people = People.create(name, username)
         people.get().genpass(password)
         user = User.get(username)
         if user is None:
             user = User.get(username)
             logging.warning("User get retry")
         if user is not None:
             login_user(user, remember=True)
         else:
             logging.warning("Still not found")
         return {'id': people.id(), "username": username, "name": name, "admin": False}