def on_createuser(self, request): print request.form if not 'user' in request.form or not 'authkey' in request.form: raise BadRequest("missing user or authkey") logging.info('user and authkey set') user = request.form['user'] authkey = request.form['authkey'] if self.user_exists(user): raise BadRequest("user already exists") create_user(user, authkey) return success_response()
def main(): if len(sys.argv) != 3: print "usage: python newuser.py <username> <accesstoken>" return 2 username = sys.argv[1] accesstoken = sys.argv[2] return utils.create_user(username, accesstoken, 1)