def create_user(self, username, password, email='', admin=False): log.info('creating administrator user %s', username) form_data = dict(username=username, password=password, active=True, admin=admin, name='RhodeCode', lastname='Admin', email=email) User.create(form_data)
def create_default_user(self): log.info('creating default user') #create default user for handling default permissions. form_data = dict(username='******', password=str(uuid.uuid1())[:8], active=False, admin=False, name='Anonymous', lastname='User', email='*****@*****.**') User.create(form_data)
def create_user(self, apiuser, username, password, active, admin, name, lastname, email): """ Creates new user :param apiuser: :param username: :param password: :param active: :param admin: :param name: :param lastname: :param email: """ form_data = dict( username=username, password=password, active=active, admin=admin, name=name, lastname=lastname, email=email ) try: u = User.create(form_data) return {"id": u.user_id, "msg": "created new user %s" % name} except Exception: log.error(traceback.format_exc()) raise JSONRPCError("failed to create user %s" % name)