<commit_before>const keystone	= require('keystone'),
	  Types		= keystone.Field.Types;

// Create model. Additional options allow menu name to be used what auto-generating URLs
const StaffEmailContact = new keystone.List( 'Staff Email Contact', {
	autokey: { path: 'key', from: 'emailTarget', unique: true },
	map: { name: 'emailTarget' }
});

// Create fields
StaffEmailContact.add({
	emailTarget: { type: Types.Relationship, label: 'primary contact for', ref: 'Email Target', required: true, initial: true },
	staffEmailContact: { type: Types.Relationship, label: 'staff email contact', ref: 'Admin', filters: { isActive: true }, required: true, initial: true }
});

// Define default columns in the admin interface and register the model
StaffEmailContact.defaultColumns = 'emailTarget, staffEmailContact';
StaffEmailContact.register();<commit_msg>fix bug preventing users from opening staff email contact models in the admin UI<commit_after>const keystone	= require('keystone'),
	  Types		= keystone.Field.Types;

// Create model. Additional options allow menu name to be used what auto-generating URLs
const StaffEmailContact = new keystone.List( 'Staff Email Contact', {
	autokey: { path: 'key', from: 'emailTarget', unique: true }
});

// Create fields
StaffEmailContact.add({
	emailTarget: { type: Types.Relationship, label: 'primary contact for', ref: 'Email Target', required: true, initial: true },
	staffEmailContact: { type: Types.Relationship, label: 'staff email contact', ref: 'Admin', filters: { isActive: true }, required: true, initial: true }
});

// Define default columns in the admin interface and register the model
StaffEmailContact.defaultColumns = 'emailTarget, staffEmailContact';
StaffEmailContact.register();
{'fraction_non_alphanumeric': 0.11795166858457998, 'fraction_numerical': 0.0, 'mean_word_length': 5.537593984962406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5080331', 'n_tokens_mistral': 484, 'n_tokens_neox': 463, 'n_words': 175}