<commit_before>/**
 * This script automatically creates a default Admin user when an
 * empty database is used for the first time. You can use this
 * technique to insert data into any List you have defined.
 * 
 * Alternatively, you can export a custom function for the update:
 * module.exports = function(done) { ... }
 */

exports.create = {
	User: [{
		userType: 'Administrator',
		name: {
			first: 'Admin',
			last: 'User'
		},
		email: '<EMAIL>',
		password: '<PASSWORD>'
	}]
};

/*

// This is the long-hand version of the functionality above:

var keystone = require('keystone'),
	async = require('async'),
	User = keystone.list('User');

var admins = [
	{ email: '<EMAIL>', password: '<PASSWORD>', name: { first: 'Admin', last: 'User' } }
];

function createAdmin(admin, done) {
	
	var newAdmin = new User.model(admin);
	
	newAdmin.isAdmin = true;
	newAdmin.save(function(err) {
		if (err) {
			console.error("Error adding admin " + admin.email + " to the database:");
			console.error(err);
		} else {
			console.log("Added admin " + admin.email + " to the database.");
		}
		done(err);
	});<commit_msg>Create script to automatically create the core Admin users.<commit_after>/**
 * This script automatically creates a default Admin user when an
 * empty database is used for the first time. You can use this
 * technique to insert data into any List you have defined.
 * 
 * Alternatively, you can export a custom function for the update:
 * module.exports = function(done) { ... }
 */

exports.create = {
	User: [{
		permissions: {
			isVerified: true,
			isActive: true
		},
		name: {
			first: 'Admin',
			last: 'User'
		},
		password: '<PASSWORD>',
		email: '<EMAIL>'
	},{
		permissions: {
			isVerified: true,
			isActive: true
		},
		name: {
			first: 'Jared',
			last: 'Collier'
		},
		password: '<PASSWORD>',
		email: '<EMAIL>'
	},{
		permissions: {
			isVerified: true,
			isActive: true
		},
		name: {
			first: 'Tom',
			last: 'Koch'
		},
		password: '<PASSWORD>',
		email: '<EMAIL>'
	},{
		permissions: {
			isVerified: true,
			isActive: true
		},
		name: {
			first: 'Guillermo',
			last: 'Martin'
		},
		password: '<PASSWORD>',
		email: '<EMAIL>'
	},{
		permissions: {
			isVerified: true,
			isActive: true
		},
		name: {
			first: 'Lisa',
			last: 'Funaro'
		},
		password: '<PASSWORD>',
		email: '<EMAIL>'
	}]
};

/*

// This is the long-hand version of the functionality above:

var keystone = require('keystone'),
	async = require('async'),
	User = keystone.list('User');

var admins = [
	{ email: '<EMAIL>', password: '<PASSWORD>', name: { first: 'Admin', last: 'User' } }
];

function createAdmin(admin, done) {
	
	var newAdmin = new User.model(admin);
	
	newAdmin.isAdmin = true;
	newAdmin.save(function(err) {
		if (err) {
			console.error("Error adding admin " + admin.email + " to the database:");
			console.error(err);
		} else {
			console.log("Added admin " + admin.email + " to the database.");
		}
		done(err);
	});
{'fraction_non_alphanumeric': 0.16148648648648647, 'fraction_numerical': 0.0, 'mean_word_length': 3.335285505124451, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5075229', 'n_tokens_mistral': 1103, 'n_tokens_neox': 993, 'n_words': 293}